Skip to content

Latest commit

 

History

History
42 lines (25 loc) · 1.72 KB

OneVersusOne.md

File metadata and controls

42 lines (25 loc) · 1.72 KB

One Versus One Classification COneVersusOne

One vs. one method provides a way to solve a multi-class classification problem using only binary classifiers.

The original classification problem is represented as a series of binary classification problems, one for each pair of classes, that determine the pairwise probabilities for the object to belong to one class or another.

Afterfwards the optimal probabilities for each class are found by solving an optimization task, which is described in Section 4 of this article.

In NeoML library this method is implemented by the COneVersusOne class. It exposes a Train method for creating a classification model.

Training settings

The only parameter the algorithm requires is the pointer to the basic binary classification method, represented by an object that implements the ITrainingModel interface.

Model

The trained model is an ensemble of binary classification models. It implements the IModel interface.

Classification result

It provides the standard Classify method which writes the result into the given CClassificationResult.

Sample

Here is a simple example of training a one-versus-one model using a linear binary classifier.

CLinear linear( EF_LogReg );

COneVersusOne oneVersusOne( linear );
CPtr<IModel> model = oneVersusOne.Train( *trainData );