With logistic regression

The Shogun library implements multi-class logistic regression in the CMulticlassLogisticRegression class. This class has a single configurable parameter named z, and it is a regularization coefficient. To select the best value for it, we use the grid search approach with cross-validation. The following code snippets show this approach.

Assume we have the following train and test data:

Some<CDenseFeatures<DataType>> features;Some<CMulticlassLabels> labels;Some<CDenseFeatures<DataType>> test_features;Some<CMulticlassLabels> test_labels; 

As we decided to use a cross-validation process, let's define the required objects as follows:

// search for hyper-parametersauto root = some<CModelSelectionParameters>();// z - regularization ...

Get Hands-On Machine Learning with C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.