liana.method.find_causalnet#
- liana.method.find_causalnet(prior_graph, input_node_scores, output_node_scores, node_weights=None, node_cutoff=0.1, min_penalty=0.01, max_penalty=1.0, missing_penalty=10, edge_penalty=0.01, solver=None, seed=1337, max_runs=1, stable_runs=5, verbose=True, **kwargs)#
Find the causal network that best explains the input/output node scores.
- Parameters:
prior_graph (corneto.Graph) – The prior graph to use for the search.
input_node_scores (dict) – A dictionary of input node scores.
output_node_scores (dict) – A dictionary of output node scores.
node_weights (dict, optional) – A dictionary of node weights. The keys are the node names, the values are the weights. If None, all nodes will have the same weight.
node_cutoff (float) – The cutoff to use for the node weights. Nodes with a weight below this cutoff will be assigned the max_penalty, nodes with a weight above this cutoff will be assigned the min_penalty. Only used if node_weights is not None. Default: 0.1
min_penalty (float) – The minimum penalty to assign to nodes with a weight above the cutoff. Only used if node_weights is not None. Default: 0.01
max_penalty (float) – The maximum penalty to assign to nodes with a weight below the cutoff Only used if node_weights is not None. Default: 1.0
missing_penalty (float) – The penalty to assign to nodes that are not measured. Default: 10
edge_penalty (float) – The penalty to assign to edges. Default: 0.01
solver (str, optional) – The solver to use. If None, the default solver will be used. Default: None It will default to the solver included in SCIPY, if no other solver is available.
seed (int, optional) – The seed to use for the random number generator. Default: 1337
max_runs (int, optional) – The maximum number of runs to perform. Consider increasing this value if the solver does not converge. In each run, the noise added to the edge and node penalties is perturbed slightly (iterating over the seed). By default, only 1 run is performed.
stable_runs (int, optional) – The number of consecutive stable solutions requires to interrupt the iteration over max_runs. Only used if max_runs is not == 1. Default: 5
verbose (bool, optional) – Whether to print progress information. Default: True
**kwargs (dict, optional) – Additional arguments to pass to the solver.
- Returns:
- df_all
DataFrame containing the resulting causal network
- P
Insantce of the Corneto problem definition