API reference

andrey.data.CausePair#

class andrey.data.CausePair(data, graph, feature_names, description, env=None, targets=None, conditions=None, name='', weight=0.0, cause=(), effect=())[source]#

One pair of the Tübingen collection: a RealDataset and what the collection records.

data, graph, feature_names, and description are those of RealDataset; description is the pair’s own description file, which gives its variables, units, source, and the reason for its reference direction. env, targets, and conditions are None.

name#

The pair’s name in the collection, "pair0001" to "pair0108".

Type:

str

weight#

The collection’s weight for the pair. The pairs from one source share weights that sum to 1, so a weighted average over pairs does not count a source once per pair; 0 marks a pair the collection leaves out of such averages. Use it as the weight of the pair’s correct-or-not outcome.

Type:

float

cause, effect

The columns of the cause and of the effect, by name. A univariate pair has one each, named "x" and "y" after the first and the second variable of its files, in the order of the file: the cause is "x" in some pairs and "y" in others. A multivariate pair names its columns x1, x2, ... and y1, y2, ....

Type:

tuple of str

property multivariate: bool#

Whether the cause or the effect has more than one column.

The collection states only that the cause block acts on the effect block, so graph of a multivariate pair has an arc from each cause column to each effect column and says nothing about the columns inside a block. Methods that decide the direction between two columns read the other pairs.