Mixin class for all density estimators in scikit-learn.
This mixin defines the following functionality:
"density_estimator" through the estimator_type tag;score method that default that do no-op.>>> 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
Return the score of the model on the data X.
Test samples.
Not used, present for API consistency by convention.
© 2007–2025 The scikit-learn developers
Licensed under the 3-clause BSD License.
https://scikit-learn.org/1.6/modules/generated/sklearn.base.DensityMixin.html