std::vector<double>_value_svm;//!< Value of the feature converted to a range of -1.0 to 1.0
std::vector<double>_test_value_svm;//!< Value of the feature converted to a range of -1.0 to 1.0
std::vector<fxn_nterms_pair>_fxn_list;
std::vector<fxn_nterms_pair>_fxn_list;//!< list of functions used for evaluating feature values
std::vector<std::string>_x_in_expr_list;
std::vector<std::string>_x_in_expr_list;//!< vector storing the expressions for all primary features that show up in feature in the order they appear in the postfix notation
std::string_expr_postfix;//!< postfix expression for the feature
std::string_latex_expr;//!< postfix expression for the feature
...
...
@@ -59,8 +59,7 @@ protected:
double_w_remap_svm;//!< value to remap the w from SVM to real life
int_rung;//!< rung of the feature
int_n_leaves;
int_n_leaves;//!< Total number of primary features of the feature
public:
/**
* @brief Base Constructor
...
...
@@ -75,7 +74,8 @@ public:
* @param rung the rung of the feature
* @param expr Expression for the feature
* @param value Value of the feature for each sample
* @param value Value of the feature for each test sample
* @param test_value Value of the feature for each test sample
* @param x_in_expr_list //!< vector storing the expressions for all primary features that show up in feature in the order they appear in the postfix notation
* @param unit Unit of the feature
*/
ModelNode(
...
...
@@ -129,30 +129,101 @@ public:
*/
~ModelNode();
/**
* @brief Generate the list of functions used to evaluate the value of this feature for a new data point from the postfix expression
*/
voidgenerate_fxn_list();
/**
* @brief Evaluate the model for a new point
*
* @param x_in pointer to the new data point (order the same as appending the results of _feats[nn]->get_x_in_expr_list() for all feature)
* @return The prediction of the model for a given data point
*/
doubleeval(double*x_in);
/**
* @brief Evaluate the model for a new point
*
* @param x_in The data point to evaluate the model (order the same as appending the results of _feats[nn]->get_x_in_expr_list() for all feature)
* @return The prediction of the model for a given data point
*/
doubleeval(std::vector<double>x_in);
/**
* @brief Evaluate the model for a new point
*
* @param x_in_dct Dictionary describing the new point ("feature expr": value)
* @return The prediction of the model for a given data point
*/
doubleeval(std::map<std::string,double>x_in_dct);
/**
* @brief Evaluate the model for a new set of new points
*
* @param x_in a vector of pointers to the set of values for new data points (one pointer per each feature and order the same as appending the results of _feats[nn]->get_x_in_expr_list() for all feature)
* @return The prediction of the model for a given set of data points
* @brief Evaluate the model for a set of new points
*
* @param x_in The set data for a set of new data points (size of n_feature x n_points, and order the same as appending the results of _feats[nn]->get_x_in_expr_list() for all feature)
* @return The prediction of the model for a given data point
* @brief Evaluate the model for a set of new points
*
* @param x_in_dct The set of data points to evaluate the model. Keys must be strings representing feature expressions and vectors must be the same length
* @return The prediction of the model for a given data point
* @brief Evaluate the model for a set of new points
*
* @param x_in The set data for a set of new data points (size of n_feature x n_points, and order the same as appending the results of _feats[nn]->get_x_in_expr_list() for all feature)
* @return The prediction of the model for a given data point
*/
np::ndarrayeval_many_py(np::ndarrayx_in);
/**
* @brief Evaluate the model for a set of new points
*
* @param x_in_dct The set of data points to evaluate the model. Keys must be strings representing feature expressions and vectors must be the same length
* @return The prediction of the model for a given data point
*/
np::ndarrayeval_many_py(py::dictx_in);
/**
* @brief get the list of feature expressions for each of the leaves
* @return Python list containing the expression for each leaf in the binary expression tree