Package se.hb.jcp.ml
Interface IClassifier
-
- All Superinterfaces:
IClassifierInformation,java.io.Serializable
- All Known Subinterfaces:
IClassProbabilityClassifier,ISVMClassifier
- All Known Implementing Classes:
BogusClassProbabilityClassifier,ClassifierBase,ExtremelyRandomizedTreesClassifier,LinearClassifier,RandomForestClassifier,SVMClassifier,SVMClassifier,SVMClassifier
public interface IClassifier extends IClassifierInformation, java.io.Serializable
Represents an instance of a specific machine learning classification algorithm. Contract for JCP use: 1. The Classifier must be serializable, both as untrained and as trained. 2. The fitNew and predict methods of the Classifier must be reentrant.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidfit(cern.colt.matrix.DoubleMatrix2D x, double[] y)Trains this classifier using the supplied data.IClassifierfitNew(cern.colt.matrix.DoubleMatrix2D x, double[] y)Trains and returns a copy of this classifier using the supplied data.doublepredict(cern.colt.matrix.DoubleMatrix1D instance)Predicts the target for the supplied instance.-
Methods inherited from interface se.hb.jcp.ml.IClassifierInformation
getAttributeCount, getLabels, isTrained, nativeStorageTemplate
-
-
-
-
Method Detail
-
fit
void fit(cern.colt.matrix.DoubleMatrix2D x, double[] y)Trains this classifier using the supplied data.- Parameters:
x- the attributes of the instances.y- the targets of the instances.
-
fitNew
IClassifier fitNew(cern.colt.matrix.DoubleMatrix2D x, double[] y)
Trains and returns a copy of this classifier using the supplied data.- Parameters:
x- the attributes of the instances.y- the targets of the instances.- Returns:
- a new IClassifier instance trained with the supplied data and using the same algorithm and parameter settings as the parent instance.
-
predict
double predict(cern.colt.matrix.DoubleMatrix1D instance)
Predicts the target for the supplied instance.- Parameters:
instance- the instance- Returns:
- the predicted target of the instance.
-
-