1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-18 08:44:11 +08:00

Make Stump::predict const

This commit is contained in:
Vlad Shakhuro
2014-06-24 08:59:31 +04:00
parent 7ecf95ec25
commit ab9d2496c2
2 changed files with 2 additions and 2 deletions

View File

@@ -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 */

View File

@@ -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_;
}