How can I interpret the scores generated by the function score_samples(X)
from a scikit-learn OneClassSVM
model? Is there a way to tell when one sample is "more anomalous" than other? The predict()
and decision_function()
functions have sign information, yet the score_samples
function does not have this.
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)
# array([1.7798..., 2.0547..., 2.0556..., 2.0561..., 1.7332...])
```