Source code for dowhy.gcm.ml.prediction_model

from abc import abstractmethod

import numpy as np


[docs]class PredictionModel: """Represents general prediction model implementations. Each prediction model should provide a fit and a predict method."""
[docs] @abstractmethod def fit(self, X: np.ndarray, Y: np.ndarray) -> None: raise NotImplementedError
[docs] @abstractmethod def predict(self, X: np.ndarray) -> np.ndarray: raise NotImplementedError
[docs] @abstractmethod def clone(self): """ Clones the prediction model using the same hyper parameters but not fitted. :return: An unfitted clone of the prediction model. """ raise NotImplementedError