DOC add doc example to OneClassSVM
@@ -1155,6 +1155,15 @@ class OneClassSVM(BaseLibSVM, OutlierMixin):
The offset is the opposite of `intercept_` and is provided for
consistency with other outlier detection algorithms.
+ Examples
+ --------
+ >>> from sklearn.svm import OneClassSVM
+ >>> X = [[0], [0.44], [0.45], [0.46], [1]]
+ >>> clf = OneClassSVM(gamma='auto').fit(X)
+ >>> clf.predict(X)
+ array([-1, 1, 1, 1, -1])
+ >>> clf.score_samples(X) # doctest: +ELLIPSIS
+ array([1.7798..., 2.0547..., 2.0556..., 2.0561..., 1.7332...])
"""
_impl = 'one_class'
