3

I have the following problem.

The minimization problem of the SVM that I want to solve is:

$$ \min_{w, b} \frac{1}{2}w^{T}w + \sum^{m}_{i=1}C_{i}xi_{i} $$ Subject to: $$ y_{i}(w^{T}x_{i} - b) \geq 1 - \xi_{i} $$ $$ \xi_{i} \geq 0 $$ $$ C_{i} = \nu_{i}C $$ where $\nu_{i}$ is some function.

Now the minimization problem that the base SVM solves is: $$ \min_{w, b} \frac{1}{2}w^{T}w + C\sum^{m}_{i=1}xi_{i} $$ Subject to: $$ y_{i}(w^{T}x_{i} - b) \geq 1 - \xi_{i} $$ $$ \xi_{i} \geq 0 $$

reference: https://www.sciencedirect.com/science/article/abs/pii/S0957417414006228?via%3Dihub

or: https://www.researchgate.net/publication/268753346_Using_Volume_Weighted_Support_Vector_Machines_with_walk_forward_testing_and_feature_selection_for_the_purpose_of_creating_stock_trading_strategy

I was wondering is there a way I can change implement this in sklearn, its for a paper that im working.

Kind regards.

Ethan
  • 1,625
  • 8
  • 23
  • 39
cem
  • 33
  • 5
  • 1
    Related: https://thecleverprogrammer.com/2021/01/25/support-vector-machine-tutorial-using-python/ – kenorb Jan 31 '22 at 12:28

1 Answers1

2

This is already implemented, with the sample_weights parameter of the fit method. They play the role of your $\nu_i$.

Ben Reiniger
  • 11,094
  • 3
  • 16
  • 53