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:

__annotations__ = {}
__doc__ = 'Execute the causal inference by search method\n\n    Attributes:\n\n    '
__init__() None[source]

Constructor

Arguments:

Returns:

__module__ = 'openasce.discovery.search_discovery.search_discovery'
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_discovery_test module

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

__dict__ = mappingproxy({'__module__': 'openasce.discovery.search_discovery.search_strategy', '__doc__': 'General class to implement different structure learning methods\n\n    Attributes\n        edge_gain (float): the minimal gain of adding edge.\n        target_name (str): the name of the node that will be label.\n    ', '__init__': <function Strategy.__init__>, 'run': <function Strategy.run>, 'best_parent': <function Strategy.best_parent>, 'k2': <function Strategy.k2>, '__dict__': <attribute '__dict__' of 'Strategy' objects>, '__weakref__': <attribute '__weakref__' of 'Strategy' objects>, '__annotations__': {}})
__doc__ = 'General class to implement different structure learning methods\n\n    Attributes\n        edge_gain (float): the minimal gain of adding edge.\n        target_name (str): the name of the node that will be label.\n    '
__init__(node_names: List[str], **kwargs)[source]

Contructor

Parameters

node_names – the name of nodes

__module__ = 'openasce.discovery.search_discovery.search_strategy'
__weakref__

list of weak references to the object (if defined)

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: