I want to give weights to some data points

Specifically, these are points related to anomalies

(I'm implementing one-class SVM for anomaly detection)

Exactly, I want to consider some data points that are likely to be anomalies as more important data points

Is it possible in one-class SVM ?


If I understood correctly, you are tring to apply more weight in advance to certain points which you consider (based on domain knowledge?) that are likely to be anomalies, correct? Your one-class support vector machine is meant to give you that insight, instead of specifying it in advance, so you could check if those points are actually far from the "normality" decision surface found by the algorithm itself, to confirm that those are novelties, also quantitative via the decision_function method:

enter image description here

Here you can find a more detailed answer on how it works, in case you want to have a look.

  • $\begingroup$ Thk y for your explanation However, there is a option for sample_weight in fit function (OCSVM, sklearn). If I use the option for sample_weight , I might give some weight to some point(that are likely to be more normal points), right? $\endgroup$ Aug 3 '21 at 10:00
  • $\begingroup$ Indeed that is possible based on the official documentation. Nevertheless, I think you should be careful on which samples you put that emphasis, and how much weight you give to them, but the idea itself sounds interesting $\endgroup$
    – German C M
    Aug 3 '21 at 11:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.