Skip to content

Commit

Permalink
tree model updated
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaJoctan committed Jul 31, 2024
1 parent a6c7f25 commit ff83426
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions Decision Tree/tree.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ public:

void fit(const matrix &x, const vector &y);
void print_tree(Node *tree, string indent=" ",string padl="");
double predict_bin(const vector &x);
vector predict_bin(const matrix &x);

virtual double predict_bin(const vector &x);
virtual vector predict_bin(const matrix &x);
};
//+------------------------------------------------------------------+
//| |
Expand Down Expand Up @@ -455,6 +456,10 @@ public:
~CDecisionTreeRegressor(void);

void fit(matrix &x, vector &y);

virtual double predict(const vector &x); //this is used for live trading
virtual vector predict(const matrix &x);

};
//+------------------------------------------------------------------+
//| |
Expand Down Expand Up @@ -597,3 +602,17 @@ double CDecisionTreeRegressor::calculate_leaf_value(vector &Y)
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
vector CDecisionTreeRegressor::predict(const matrix &x)
{
return predict_bin(x);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
double CDecisionTreeRegressor::predict(const vector &x)
{
return predict_bin(x);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+

0 comments on commit ff83426

Please sign in to comment.