openasce.discovery.search_discovery package

Submodules

openasce.discovery.search_discovery.search_discovery module

class openasce.discovery.search_discovery.search_discovery.CausalSearchDiscovery[source]

Bases: Discovery

Execute the causal inference by search method

Attributes:

Constructor

Arguments:

Returns:

__init__() None[source]

Constructor

Arguments:

Returns:

fit(*, X: Union[ndarray, Callable], **kwargs) None[source]

Feed the sample data

Parameters

X (num of samples, features or callable returning np.ndarray) – samples

Returns:

get_result() Tuple[CausalGraph, float][source]

Get the causal graph sample data

Parameters

X (num of samples, features or callable returning np.ndarray) – samples

Returns:

openasce.discovery.search_discovery.search_strategy module

class openasce.discovery.search_discovery.search_strategy.Strategy(node_names: List[str], **kwargs)[source]

Bases: object

General class to implement different structure learning methods

Attributes

edge_gain (float): the minimal gain of adding edge. target_name (str): the name of the node that will be label.

Contructor

Parameters

node_names – the name of nodes

__init__(node_names: List[str], **kwargs)[source]

Contructor

Parameters

node_names – the name of nodes

best_parent(*, g, s, node_i, data, max_parents, r, s_i)[source]

Search for best parent

Returns g by adding to node i the best parent that maximizes the score

Arguments:

Returns:

k2(data: ndarray, **kwargs)[source]

Implements k2 algorithm

Agrument:

data: the features of samples

run(data: ndarray, **kwargs) Tuple[source]

Run the actual strategy

Parameters
  • data – the features of samples

  • **kwargs (dict) – dictionnary with method specific args

Returns: