mulink.simulate.hierarchical_mudata#
- mulink.simulate.hierarchical_mudata(n_mod, *, n_obs=5, n_vertices=2, min_edges=2, extra_edge_probability=0.2, extra_edge_levels=None, transitive_closure=True, varp_key='feature_mapping', random_state=42)#
Generate a mudata object with hierarchical feature relationship
- Parameters:
n_mod (
int) – Number of modalities (levels) in the objectn_obs (
int(default:5)) – Number of observations in the objectn_vertices (
int(default:2)) – Number of vertices in the level with the lowest cardinalitymin_edges (default:
2) – Minimum number of vertices between adjacent levelsextra_edge_probability (
float|None(default:0.2)) – Probability of adding an additional edge between vertices of adjacent levels. IfNone, the feature relationship between different levels is represented by a tree. This means that a feature from level n+1 maps to exactly one feature in level nextra_edge_levels (
list[int] |None(default:None)) – Constrain the addition of extra edges to these levels of the final mudata object (starting at 0). Must not contain the highest level, as these features do not contain additional connections.transitive_closure (
bool(default:True)) – Whether to return a graph where features that are indirectly linked are connected with an explicit edge. For example, for the feature mapping A –> B –> C, the connection A –> C will also be addedvarp_key (
str(default:'feature_mapping')) – Name of key that contains the feature mapping in.varpattribute of the returnedmudata.MuDataobjectrandom_state (
int(default:42)) – Random state for the simulation
- Returns:
A
mudata.MuDataobject with explicit feature mapping. The individual modalities/feature-levels are indicated withmod{idx}. The feature mapping is added as adjacency matrix with in the.varpattribute asvarp_key. In the matrix, entry (i, j) corresponds to a directed edge from feature i to feature j.