Package se.hb.jcp.ml
Class BogusClassProbabilityClassifier
- java.lang.Object
-
- se.hb.jcp.ml.ClassifierBase
-
- se.hb.jcp.ml.BogusClassProbabilityClassifier
-
- All Implemented Interfaces:
java.io.Serializable,IClassifier,IClassifierInformation,IClassProbabilityClassifier
public class BogusClassProbabilityClassifier extends ClassifierBase implements IClassProbabilityClassifier
Adds a bogus class probability estimate to the underlying machine learning classification algorithm.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BogusClassProbabilityClassifier(IClassifier classifier, double[] classes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IClassifierfitNew(cern.colt.matrix.DoubleMatrix2D x, double[] y)Trains and returns a copy of this classifier using the supplied data.protected voidinternalFit(cern.colt.matrix.DoubleMatrix2D x, double[] y)Trains this classifier using the supplied data.cern.colt.matrix.DoubleMatrix1DnativeStorageTemplate()Returns a value of the DoubleMatrix1D derived class that is the native storage format for the classifier.doublepredict(cern.colt.matrix.DoubleMatrix1D instance)Predicts the target for the supplied instance.doublepredict(cern.colt.matrix.DoubleMatrix1D instance, double[] probabilityEstimates)Predicts the target probabilities for the supplied instance.-
Methods inherited from class se.hb.jcp.ml.ClassifierBase
fit, getAttributeCount, getLabels, isTrained
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface se.hb.jcp.ml.IClassifier
fit
-
Methods inherited from interface se.hb.jcp.ml.IClassifierInformation
getAttributeCount, getLabels, isTrained
-
-
-
-
Constructor Detail
-
BogusClassProbabilityClassifier
public BogusClassProbabilityClassifier(IClassifier classifier, double[] classes)
-
-
Method Detail
-
internalFit
protected void internalFit(cern.colt.matrix.DoubleMatrix2D x, double[] y)Trains this classifier using the supplied data.- Specified by:
internalFitin classClassifierBase- Parameters:
x- the attributes of the instances.y- the targets of the instances.
-
fitNew
public IClassifier fitNew(cern.colt.matrix.DoubleMatrix2D x, double[] y)
Trains and returns a copy of this classifier using the supplied data.- Specified by:
fitNewin interfaceIClassifier- 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
public double predict(cern.colt.matrix.DoubleMatrix1D instance)
Predicts the target for the supplied instance.- Specified by:
predictin interfaceIClassifier- Parameters:
instance- the instance- Returns:
- the predicted target of the instance.
-
predict
public double predict(cern.colt.matrix.DoubleMatrix1D instance, double[] probabilityEstimates)Predicts the target probabilities for the supplied instance.- Specified by:
predictin interfaceIClassProbabilityClassifier- Parameters:
instance- the instanceprobabilityEstimates- a double[] array for storing the predicted probabilities for each of target values in the order assumed by JCP.- Returns:
- the predicted target of the instance.
-
nativeStorageTemplate
public cern.colt.matrix.DoubleMatrix1D nativeStorageTemplate()
Returns a value of the DoubleMatrix1D derived class that is the native storage format for the classifier.- Specified by:
nativeStorageTemplatein interfaceIClassifierInformation- Returns:
- a value of the DoubleMatrix1D derived class of the native storage format for the classifier.
-
-