/**
* <p>Predicts a response for an input sample.</p>
*
* <p>The method predicts the response corresponding to the given sample (see
* "Predicting with GBT").
* The result is either the class label or the estimated function value. The
* "CvGBTrees.predict" method enables using the parallel version of the GBT
* model prediction if the OpenCV is built with the TBB library. In this case,
* predictions of single trees are computed in a parallel fashion.</p>
*
* @param sample Input feature vector that has the same format as every training
* set element. If not all the variables were actually used during training,
* <code>sample</code> contains forged values at the appropriate places.
* @param missing Missing values mask, which is a dimensional matrix of the same
* size as <code>sample</code> having the <code>CV_8U</code> type.
* <code>1</code> corresponds to the missing value in the same position in the
* <code>sample</code> vector. If there are no missing values in the feature
* vector, an empty matrix can be passed instead of the missing mask.
* @param slice Parameter defining the part of the ensemble used for prediction.
* <p>If <code>slice = Range.all()</code>, all trees are used. Use this parameter
* to get predictions of the GBT models with different ensemble sizes learning
* only one model.</p>
* @param k Number of tree ensembles built in case of the classification problem
* (see "Training GBT"). Use this parameter to change the output to sum of the
* trees' predictions in the <code>k</code>-th ensemble only. To get the total
* GBT model prediction, <code>k</code> value must be -1. For regression
* problems, <code>k</code> is also equal to -1.
*
* @see <a href="http://docs.opencv.org/modules/ml/doc/gradient_boosted_trees.html#cvgbtrees-predict">org.opencv.ml.CvGBTrees.predict</a>
*/
public float predict(Mat sample, Mat missing, Range slice, int k)
{
float retVal = predict_0(nativeObj, sample.nativeObj, missing.nativeObj, slice.start, slice.end, k);
return retVal;
}
CvGBTrees.java 文件源码
java
阅读 19
收藏 0
点赞 0
评论 0
项目:ColorDetector
作者:
评论列表
文章目录