Mixin class for all outlier detection estimators in scikit-learn.
This mixin defines the following functionality:
set estimator type to "outlier_detector"
through the estimator_type
tag;
fit_predict
method that default to fit
and predict
.
Examples
>>> import numpy as np >>> from sklearn.base import BaseEstimator, OutlierMixin >>> class MyEstimator(OutlierMixin): ... def fit(self, X, y=None): ... self.is_fitted_ = True ... return self ... def predict(self, X): ... return np.ones(shape=len(X)) >>> estimator = MyEstimator() >>> X = np.array([[1, 2], [2, 3], [3, 4]]) >>> estimator.fit_predict(X) array([1., 1., 1.])
Perform fit on X and returns labels for X.
Returns -1 for outliers and 1 for inliers.
The input samples.
Not used, present for API consistency by convention.
Arguments to be passed to fit
.
Added in version 1.4.
1 for inliers, -1 for outliers.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4