- Python Machine Learning Cookbook(Second Edition)
- Giuseppe Ciaburro Prateek Joshi
- 103字
- 2021-06-24 15:40:59
How it works...
In this recipe, we have used a SVM classifier to find the best separating boundary between a dataset of points. To address a data-balancing problem, we once again used the linear Kernel method, but we implemented a class_weight keyword in the fit method. The class_weight variable is a dictionary in the form {class_label: value}, where value is a floating-point number greater than 0 that modifies the C parameter of the class (class_label), setting it with a new value, obtained by multiplying the old C value with that specified in the value attribute (C * value).