Source code for dowhy.gcm.density_estimator
from abc import ABC, abstractmethod
import numpy as np
[docs]class DensityEstimator(ABC):
[docs] @abstractmethod
def fit(self, X: np.ndarray) -> None:
raise NotImplementedError
[docs] @abstractmethod
def density(self, X: np.ndarray) -> np.ndarray:
"""Returns the density of each input."""
raise NotImplementedError