Used the Wisconsin Breast Cancer Diagnostic data set, which has been pre-processed and partitioned into training, validation and test sets.
Model Learning: Used scikit-learn's SVC function to learn SVM models with radial-basis-function (RBF) kernels for each combination of C and γ in {10-2, 10-1, 1, 101, 102}, and training them with the Training set.
Loss computation: Used scikit-learn's metrics.hinge_loss function to find the maximum-margin classification error, and compute the training and validation error for each combination of tuning parameters (C and γ).
Final Model Selection: Used the Validation set to select the best classifier corresponding to the best parameter values, Cbest and γbest, for which the validation error is minimum. Then fit the finalized model with the training data.
Accuracy testing: The accuracy score of the selected model is computed on the Test set.
$ python3 build_model.py
Building SVM model for Breast Cancer Diagnosis...
Data loaded.
Model learning completed.
Best Model selected. Accuracy 96.521739%
Model saved --> SVM_model.sav
$ python3 predict.py SVM_model.sav
[1.]