|
OpenCV 2.4.6 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opencv.ml.CvStatModel org.opencv.ml.CvBoost
public class CvBoost
Boosted tree classifier derived from "CvStatModel".
Field Summary | |
---|---|
static int |
DEFAULT
|
static int |
DISCRETE
|
static int |
GENTLE
|
static int |
GINI
|
static int |
LOGIT
|
static int |
MISCLASS
|
static int |
REAL
|
static int |
SQERR
|
Constructor Summary | |
---|---|
CvBoost()
Default and training constructors. |
|
CvBoost(Mat trainData,
int tflag,
Mat responses)
Default and training constructors. |
|
CvBoost(Mat trainData,
int tflag,
Mat responses,
Mat varIdx,
Mat sampleIdx,
Mat varType,
Mat missingDataMask,
CvBoostParams params)
Default and training constructors. |
Method Summary | |
---|---|
void |
clear()
|
float |
predict(Mat sample)
Predicts a response for an input sample. |
float |
predict(Mat sample,
Mat missing,
Range slice,
boolean rawMode,
boolean returnSum)
Predicts a response for an input sample. |
void |
prune(Range slice)
Removes the specified weak classifiers. |
boolean |
train(Mat trainData,
int tflag,
Mat responses)
Trains a boosted tree classifier. |
boolean |
train(Mat trainData,
int tflag,
Mat responses,
Mat varIdx,
Mat sampleIdx,
Mat varType,
Mat missingDataMask,
CvBoostParams params,
boolean update)
Trains a boosted tree classifier. |
Methods inherited from class org.opencv.ml.CvStatModel |
---|
load, load, save, save |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT
public static final int DISCRETE
public static final int GENTLE
public static final int GINI
public static final int LOGIT
public static final int MISCLASS
public static final int REAL
public static final int SQERR
Constructor Detail |
---|
public CvBoost()
Default and training constructors.
The constructors follow conventions of "CvStatModel.CvStatModel". See "CvStatModel.train" for parameters descriptions.
public CvBoost(Mat trainData, int tflag, Mat responses)
Default and training constructors.
The constructors follow conventions of "CvStatModel.CvStatModel". See "CvStatModel.train" for parameters descriptions.
trainData
- a trainDatatflag
- a tflagresponses
- a responsespublic CvBoost(Mat trainData, int tflag, Mat responses, Mat varIdx, Mat sampleIdx, Mat varType, Mat missingDataMask, CvBoostParams params)
Default and training constructors.
The constructors follow conventions of "CvStatModel.CvStatModel". See "CvStatModel.train" for parameters descriptions.
trainData
- a trainDatatflag
- a tflagresponses
- a responsesvarIdx
- a varIdxsampleIdx
- a sampleIdxvarType
- a varTypemissingDataMask
- a missingDataMaskparams
- a paramsMethod Detail |
---|
public void clear()
public float predict(Mat sample)
Predicts a response for an input sample.
The method runs the sample through the trees in the ensemble and returns the output class label based on the weighted voting.
sample
- Input sample.public float predict(Mat sample, Mat missing, Range slice, boolean rawMode, boolean returnSum)
Predicts a response for an input sample.
The method runs the sample through the trees in the ensemble and returns the output class label based on the weighted voting.
sample
- Input sample.missing
- Optional mask of missing measurements. To handle missing
measurements, the weak classifiers must include surrogate splits (see
CvDTreeParams.use_surrogates
).slice
- Continuous subset of the sequence of weak classifiers to be used
for prediction. By default, all the weak classifiers are used.rawMode
- Normally, it should be set to false
.returnSum
- If true
then return sum of votes instead of the
class label.public void prune(Range slice)
Removes the specified weak classifiers.
The method removes the specified weak classifiers from the sequence.
Note: Do not confuse this method with the pruning of individual decision trees, which is currently not supported.
slice
- Continuous subset of the sequence of weak classifiers to be
removed.public boolean train(Mat trainData, int tflag, Mat responses)
Trains a boosted tree classifier.
The train method follows the common template of "CvStatModel.train". The responses must be categorical, which means that boosted trees cannot be built for regression, and there should be two classes.
trainData
- a trainDatatflag
- a tflagresponses
- a responsespublic boolean train(Mat trainData, int tflag, Mat responses, Mat varIdx, Mat sampleIdx, Mat varType, Mat missingDataMask, CvBoostParams params, boolean update)
Trains a boosted tree classifier.
The train method follows the common template of "CvStatModel.train". The responses must be categorical, which means that boosted trees cannot be built for regression, and there should be two classes.
trainData
- a trainDatatflag
- a tflagresponses
- a responsesvarIdx
- a varIdxsampleIdx
- a sampleIdxvarType
- a varTypemissingDataMask
- a missingDataMaskparams
- a paramsupdate
- Specifies whether the classifier needs to be updated
(true
, the new weak tree classifiers added to the existing
ensemble) or the classifier needs to be rebuilt from scratch
(false
).
|
OpenCV 2.4.6 Documentation | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |