# Implementing a weighted support vector machine in python

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$$

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

Kind regards.

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