Commit ab9d2496 authored by Vlad Shakhuro's avatar Vlad Shakhuro

Make Stump::predict const

parent 7ecf95ec
...@@ -147,7 +147,7 @@ public: ...@@ -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) ...@@ -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_;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment