BDVal API 20110316173314

edu.cornell.med.icb.learning
Interface Classifier

All Known Implementing Classes:
LibSvmClassifier, WekaClassifier

public interface Classifier

Abstracts a machine learning classifier.

Author:
Fabien Campagne Date: Nov 19, 2007 Time: 9:19:58 AM

Method Summary
 ClassificationParameters getParameters()
          Get parameters of the classification problem.
 String getShortName()
           
 ClassificationProblem newProblem(int size)
          Create a new classification problem for use with this classifier.
 double predict(ClassificationModel trainingModel, ClassificationProblem problem, int instanceIndex)
          Predict an instance.
 double predict(ClassificationModel trainingModel, ClassificationProblem problem, int instanceIndex, double[] probabilities)
          Estimate probabilities that an instance belongs to each class of the model.
 void setParameters(ClassificationParameters parameters)
          Set parameters of the classification problem.
 ClassificationModel train(ClassificationProblem problem)
          Train a classifier with default parameters and a given problem.
 ClassificationModel train(ClassificationProblem problem, ClassificationParameters parameters)
          Train a classifier with parameters and a given problem.
 

Method Detail

setParameters

void setParameters(ClassificationParameters parameters)
Set parameters of the classification problem.

Parameters:
parameters - Parameters to use in subsequent use of this classifier.

newProblem

ClassificationProblem newProblem(int size)
Create a new classification problem for use with this classifier.

Parameters:
size - Number of instances in the problem.
Returns:
a new classification problem with size instances.

train

ClassificationModel train(ClassificationProblem problem,
                          ClassificationParameters parameters)
Train a classifier with parameters and a given problem.

Parameters:
problem - Set of instances with labels
parameters - Paramaters of classification (i.e., cost parameter for linear SVM)
Returns:
A trained model.

train

ClassificationModel train(ClassificationProblem problem)
Train a classifier with default parameters and a given problem.

Parameters:
problem - Set of instances with labels
Returns:
A trained model.

predict

double predict(ClassificationModel trainingModel,
               ClassificationProblem problem,
               int instanceIndex)
Predict an instance.

Parameters:
trainingModel - Model used for prediction.
problem - Definition of the problem, containing the instance for which to predict
instanceIndex - Index of the instance to predict in the problem.
Returns:
Predicted label (interpretation of this value depends on classifier type and problem definition).

predict

double predict(ClassificationModel trainingModel,
               ClassificationProblem problem,
               int instanceIndex,
               double[] probabilities)
Estimate probabilities that an instance belongs to each class of the model.

Parameters:
trainingModel - Model used for prediction.
problem - Definition of the problem, containing the instance for which to predict
instanceIndex - Index of the instance to predict in the problem.
probabilities - the probability will be written for each label. probs[0]: first class, probs[1] second class, and so on.
Returns:
Predicted label

getParameters

ClassificationParameters getParameters()
Get parameters of the classification problem.

Returns:
Parameters in use by this classifier.

getShortName

String getShortName()

BDVal API 20110316173314

Copyright © 2007-2011 Institute for Computational Biomedicine, All Rights Reserved.