
Parametersĭataset ( tuple) – Couple of np.ndarray variables to classify Returns Prediction method for pairwise causal inference using the ANM model. ParametersĪ ( numpy.ndarray) – Variable seen as causeī ( numpy.ndarray) – Variable seen as effectįloat predict_proba ( data, ** kwargs ) ¶ show () anm_score ( x, y ) ¶Ĭompute the fitness score of the ANM model in the x->y direction. draw_networkx ( output, font_size = 8 ) > plt. DiGraph ( graph )) > # To view the directed graph run the following command > nx. The dataset used > # can be loaded using the cdt.data module > data, graph = load_dataset ( 'sachs' ) > output = obj. predict ( data ) > # This example uses the orient_graph() method. > from import ANM > import networkx as nx > import matplotlib.pyplot as plt > from cdt.data import load_dataset > data, labels = load_dataset ( 'tuebingen' ) > obj = ANM () > # This example uses the predict() method > output = obj. Idx ( int) – (optional) index number for printing purposesĬausation score (Value : 1 if a->b and -1 if b->a) Return type Predict_proba is meant to be overridden in all subclasses Parametersĭataset ( tuple) – Couple of np.ndarray variables to classify Prediction method for pairwise causal inference. Pandas.DataFrame predict_proba ( dataset, idx = 0, ** kwargs ) ¶ Kwargs ( dict) – additional arguments for the algorithmsĪ Dataframe with the predictions. X ( pandas.DataFrame) – a CEPC format Dataframe. Runs the score independently on all pairs. Pandas.Dataframe or networkx.Digraph predict_dataset ( x, ** kwargs ) ¶

X ( numpy.array or pandas.DataFrame or pandas.Series) – First variable or dataset.Īrgs ( numpy.array or networkx.Graph) – graph or second variable.

If x is a pandas.Series, then self.predict_proba is executed. If x is a pandas.DataFrame, then self.predict_dataset is executed. If args exists, then self.predict_proba is executed. If args is a networkx.(Di)Graph, then self.orient_graph is executed. Generic predict method, chooses which subfunction to use for a moreĭepending on the type of x and of *args, this function process to executeĭifferent functions in the priority order: The variables in df_data predict ( x, * args, ** kwargs ) ¶ Requirement : Name of the nodes in the graph correspond to name of
