causally.scm.causal_mechanism.LinearMechanism.predict
- LinearMechanism.predict(X: array) array
Apply a linera transformation on X.
Given a vector
xwith \(p\) features, the outputyis given by:\[y = \sum_{i=1}^p \alpha_i x_i\]where \(\alpha_i\) are random coefficients.
- Parameters:
X (np.array, shape (num_samples, num_parents)) – Parents’ observtations to be transformed by the causal mechanism.
- Returns:
y – The output of the causal mechanism.
- Return type:
np.array, shape (num_samples)