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