liveBook · Manning

C parameter

As explained in Grokking Machine Learning

A support-vector-machine hyperparameter that controls the trade-off between a wide margin and errors on training examples.

When should an SVM favor correct classifications over a wide boundary? The C parameter sets that trade-off: larger values emphasize classification errors; smaller values emphasize distance between the boundary lines. section 11.1

Error formula = C · (Classification Error) + (Distance Error)

The error formula weights classification error by C while leaving distance error unweighted. section 11.1

Compare two C values

On a sample dataset, C=0.01 makes some classification errors and reaches 0.867 accuracy. C=100 emphasizes classifying points correctly and has higher accuracy. section 11.2

How Grokking Machine Learning covers it

How deep it goes
Defines the weighted error formula, illustrates contrasting boundary choices, and demonstrates setting C in code.
Examples
Compares linear SVMs at C=0.01 and C=100 on a sample dataset, reporting accuracy for the smaller value.
What you can do after
Apply the trade-off in Scikit-Learn by fitting linear SVMs with different C values and comparing their accuracy.
How it connects
Connects support vector machines with classification error and distance error.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Machine Learning. The section links point to the parts of the book it draws on.