The hyperparameter 'C' in SVM (Support Vector Machine) is used to control the trade-off between having a smooth decision boundary and classifying the training points correctly.
Here is an example of how 'C' hyperparameter can be used in the SVC (Support Vector Classification) function in Python from the scikit-learn library:
main.py100 chars5 lines
In this example, the 'C' hyperparameter is set to 1.0, but you can experiment with different values to see how it affects the model's performance. A smaller value of 'C' allows for a softer margin, potentially increasing the bias but reducing the variance, whereas a larger value of 'C' enforces a harder margin, potentially overfitting the data.
gistlibby LogSnag