DensityMixin#
- 类 sklearn.base.DensityMixin[源码]#
scikit-learn 中所有密度估计器的混合类。
此混合类定义了以下功能:
通过
estimator_type
标签将估计器类型设置为"density_estimator"
;score
方法默认为空操作。
示例
>>> 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