1

I want to know how can I calculate anomaly score using decision_function(X) in One-Class SVM on my own data-set.

I have studied this post and also have seen this example:

Now I want to put my own data-set in the example given above. How is it possible for me. Thanks in advance.

kevins_1
  • 1,268
  • 2
  • 9
  • 27
Mansoor Ahmed
  • 83
  • 1
  • 8

1 Answers1

0

It's simply more negative the decision function output is, more anomalous the datapoint is.

Refer here:

Signed distance to the separating hyperplane. Signed distance is positive for an inlier and negative for an outlier.

Venkatachalam
  • 16,288
  • 9
  • 49
  • 77
  • Thanks Respected @ai_learning, If I have following parameters x=-45.67, y=-76.11 and Distance=88.77 than how can I apply decision_funcation(X) on it to find anomaly score. Could you please elaborate with some code. – Mansoor Ahmed Aug 05 '19 at 16:55
  • Sorry I am not able to understand your question. Is your input data is two dimensional? can you add some reproducible example of your oneClassSVM model? – Venkatachalam Aug 06 '19 at 03:24
  • Sorry if i could not explain my question. Yes my data is two dimensional, parameters x=-45.67, y=-76.11 and distance=88.77 is one row of my data set. I want to calculate anomaly score.I need help that what I should have for calculating anomaly score other than these parameters and what will be the python code using decision_function(X) – Mansoor Ahmed Aug 06 '19 at 08:47