mirror of
https://github.com/opencv/opencv_contrib.git
synced 2025-10-18 17:24:28 +08:00
Make Stump::predict const
This commit is contained in:
@@ -147,7 +147,7 @@ public:
|
||||
|
||||
Returns real value, sign(value) means class
|
||||
*/
|
||||
float predict(int value);
|
||||
float predict(int value) const;
|
||||
|
||||
private:
|
||||
/* Stump decision threshold */
|
||||
|
@@ -196,7 +196,7 @@ int Stump::train(const Mat& data, const Mat& labels, const Mat& weights)
|
||||
return min_row;
|
||||
}
|
||||
|
||||
float Stump::predict(int value)
|
||||
float Stump::predict(int value) const
|
||||
{
|
||||
return polarity_ * (value - threshold_) > 0 ? pos_value_ : neg_value_;
|
||||
}
|
||||
|
Reference in New Issue
Block a user