DensityMixin#
- class sklearn.base.DensityMixin[source]#
Mixin class for all density estimators in scikit-learn.
This mixin defines the following functionality:
sets estimator type to
"density_estimator"
through theestimator_type
tag;score
method that default that do no-op.
Examples
>>> from sklearn.base import DensityMixin >>> class MyEstimator(DensityMixin): ... def fit(self, X, y=None): ... self.is_fitted_ = True ... return self >>> estimator = MyEstimator() >>> hasattr(estimator, "score") True