Package se.hb.jcp.bindings.opencv
Class RandomForestClassifier
- java.lang.Object
-
- se.hb.jcp.ml.ClassifierBase
-
- se.hb.jcp.bindings.opencv.RandomForestClassifier
-
- All Implemented Interfaces:
java.io.Serializable,IClassifier,IClassifierInformation
public class RandomForestClassifier extends ClassifierBase implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected org.json.JSONObject_jsonParametersprotected org.opencv.ml.CvStatModel_model
-
Constructor Summary
Constructors Constructor Description RandomForestClassifier()RandomForestClassifier(org.json.JSONObject parameters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DenseDoubleMatrix1DasDDM1D(double[] y)protected DenseDoubleMatrix1DasDDM1D(cern.colt.matrix.DoubleMatrix1D x)protected DenseDoubleMatrix2DasDDM2D(cern.colt.matrix.DoubleMatrix2D x)IClassifierfitNew(cern.colt.matrix.DoubleMatrix2D x, double[] y)Trains and returns a copy of this classifier using the supplied data.protected org.opencv.ml.CvStatModelgetNewInstance()protected voidinternalFit(cern.colt.matrix.DoubleMatrix2D x, double[] y)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.protected org.opencv.core.TermCriteriareadTerminationCriteria()-
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
-
-
-
-
Method Detail
-
internalFit
protected void internalFit(cern.colt.matrix.DoubleMatrix2D x, double[] y)- Specified by:
internalFitin classClassifierBase
-
fitNew
public IClassifier fitNew(cern.colt.matrix.DoubleMatrix2D x, double[] y)
Description copied from interface:IClassifierTrains 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)
Description copied from interface:IClassifierPredicts the target for the supplied instance.- Specified by:
predictin interfaceIClassifier- Parameters:
instance- the instance- Returns:
- the predicted target of the instance.
-
getNewInstance
protected org.opencv.ml.CvStatModel getNewInstance()
-
asDDM2D
protected DenseDoubleMatrix2D asDDM2D(cern.colt.matrix.DoubleMatrix2D x)
-
asDDM1D
protected DenseDoubleMatrix1D asDDM1D(cern.colt.matrix.DoubleMatrix1D x)
-
asDDM1D
protected DenseDoubleMatrix1D asDDM1D(double[] y)
-
nativeStorageTemplate
public cern.colt.matrix.DoubleMatrix1D nativeStorageTemplate()
Description copied from interface:IClassifierInformationReturns 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.
-
readTerminationCriteria
protected org.opencv.core.TermCriteria readTerminationCriteria()
-
-