One-against-one Multi-class classification
using a two class classifier.
For a k class problem k(k-1) binary classes are trained for all
pairs of classes; an instance is classified to the class that
receives the highest number of votes; an instance is constructed
using a classifier that is used as a template for constructing
the actual classifiers.
|
|
|
classify(self,
data,
p)
Suppose that x is classified to class c, then the margin is
defined as the minimum margin found against the k-1 other classes |
source code
|
|
|
|
|
test(classifier,
data,
**args)
test a classifier on a given dataset |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
cv(classifier,
data,
numFolds=5,
**args)
perform k-fold cross validation |
source code
|
|
|
|
|
|
|
|
|
nCV(classifier,
data,
**args)
runs CV n times, returning a 'ResultsList' object. |
source code
|
|
|
project(self,
data)
project a test dataset to the training data features. |
source code
|
|
|
|
|
stratifiedCV(classifier,
data,
numFolds=5,
**args)
perform k-fold stratified cross-validation; in each fold the number of
patterns from each class is proportional to the relative fraction of the
class in the dataset |
source code
|
|
|
|
|
trainTest(classifierTemplate,
data,
trainingPatterns,
testingPatterns,
**args)
Train a classifier on the list of training patterns, and test it
on the test patterns |
source code
|
|
|
|