graphdot.kernel.marginalized.starting_probability module

class graphdot.kernel.marginalized.starting_probability.StartingProbability[source]

Bases: abc.ABC

Assigns non-negative starting probabilities to each node of a graph. Note that such a notion of starting probability can be safely generalize so that the probabilies does not have to sum to 1.

__call__(nodes)[source]

Takes in a dataframe of nodes and returns an array of probabilities.

Parameters:nodes (DataFrame) – Each node corresponds to a row in the data frame.
Returns:
  • p (numpy.ndarray) – The starting probabilities on each node.
  • d_p (numpy.ndarray) – The gradient of the starting probabilities with respect to the hyperparameters as a matrix where each row corresponds to one hyperparameter.
bounds

The log-scale bounds of the hyperparameters as a 2D array.

gen_expr()[source]

Returns the C++ expression for calculating the starting probability and its partial derivatives.

theta

The log-scale hyperparameters of the starting probability distribution as an ndarray.