graphid.demo.dummy_infr module

graphid.demo.dummy_infr.demodata_infr(**kwargs)[source]
Kwargs:

num_pccs (list): implicit number of individuals ccs (list): explicit list of connected components

p_incon (float): probability a PCC is inconsistent p_incomp (float): probability an edge is incomparable n_incon (int): target number of inconsistent components (default 3)

pcc_size_mean (int): average number of annots per PCC pcc_size_std (float): std dev of annots per PCC

pos_redun (int): desired level of positive redundancy

infer (bool): whether or not to run inference by default default True

ignore_pair (bool): if True ignores all pairwise dummy edge generation p_pair_neg (float): default = .4 p_pair_incmp (float): default = .2 p_pair_unrev (float): default = 0.0

CommandLine

python -m graphid.demo.dummy_infr demodata_infr:0 --show
python -m graphid.demo.dummy_infr demodata_infr:1 --show
python -m utool.util_inspect recursive_parse_kwargs:2 --mod graphid.demo.dummy_infr --func demodata_infr

Example

>>> from graphid import demo
>>> import networkx as nx
>>> kwargs = dict(num_pccs=6, p_incon=.5, size_std=2)
>>> infr = demo.demodata_infr(**kwargs)
>>> pccs = list(infr.positive_components())
>>> assert len(pccs) == kwargs['num_pccs']
>>> nonfull_pccs = [cc for cc in pccs if len(cc) > 1 and nx.is_empty(nx.complement(infr.pos_graph.subgraph(cc)))]
>>> expected_n_incon = len(nonfull_pccs) * kwargs['p_incon']
>>> n_incon = len(list(infr.inconsistent_components()))
>>> print('status = ' + ub.urepr(infr.status(extended=True)))
>>> # xdoctest: +REQUIRES(--show)
>>> infr.show(pickable=True, groupby='name_label')
>>> util.show_if_requested()

Doctest

>>> from graphid import demo
>>> import networkx as nx
>>> kwargs = dict(num_pccs=0)
>>> infr = demo.demodata_infr(**kwargs)