causally.scm.causal_mechanism.NeuralNetMechanism.predict

NeuralNetMechanism.predict(X: array) array

Generate the effect given the observations of the parent nodes.

The effect is generated as a nonlinear transformation parametrized by a neural network with a single hidden layer.

Parameters:

X (np.array, shape (num_samples, num_parents)) – Parents’ observtations to be transformed by the causal mechanism.

Returns:

y – The output of the neural network with X as input.

Return type:

np.array, shape (num_samples)