16template <ProgramType P>
28 const vector<float>&);
46 VectorXf& loss,
const vector<float>&
w)
73template <ProgramType P>
80typedef float (*funcPointer)(
const VectorXf&,
83 const vector<float>&);
93 this->set_scorer(scorer);
96 void set_scorer(
string scorer){ this->scorer = scorer; };
101 VectorXf& loss,
const vector<float>&
w)
103 if ( score_hash.find(
this->scorer) == score_hash.end() )
125template <ProgramType P>
132typedef float (*funcPointer)(
const VectorXf&,
135 const vector<float>&);
138 std::map<string, funcPointer> score_hash;
144 this->set_scorer(scorer);
152 VectorXf& loss,
const vector<float>&
w)
158 if ( score_hash.find(
this->scorer) == score_hash.end() )
void bind_engine(py::module &m, string name)
void set_scorer(string scorer)
float score(Individual< P > &ind, Dataset &data, VectorXf &loss, const Parameters ¶ms)
float score(const VectorXf &y_true, const ArrayXXf &y_pred, VectorXf &loss, const vector< float > &w)
Scorer(string scorer="multi_log")
Scorer(string scorer="log")
std::map< string, funcPointer > score_hash
float score(const VectorXf &y_true, const VectorXf &y_pred, VectorXf &loss, const vector< float > &w)
void set_scorer(string scorer)
float score(Individual< P > &ind, Dataset &data, VectorXf &loss, const Parameters ¶ms)
typename std::conditional_t< P==PT::Regressor, ArrayXf, std::conditional_t< P==PT::Representer, ArrayXXf, ArrayXf > > RetType
Scorer(string scorer="mse")
std::map< string, funcPointer > score_hash
float score(const VectorXf &y_true, const VectorXf &y_pred, VectorXf &loss, const vector< float > &w)
float(* funcPointer)(const VectorXf &, const VectorXf &, VectorXf &, const vector< float > &)
#define HANDLE_ERROR_THROW(err)
float mean_log_loss(const VectorXf &y, const VectorXf &predict_proba, VectorXf &loss, const vector< float > &class_weights)
log loss
float mean_multi_log_loss(const VectorXf &y, const ArrayXXf &predict_proba, VectorXf &loss, const vector< float > &class_weights)
Calculates the mean multinomial log loss between the predicted probabilities and the true labels.
float average_precision_score(const VectorXf &y, const VectorXf &predict_proba, VectorXf &loss, const vector< float > &class_weights)
Calculates the average precision score between the predicted probabilities and the true labels.
float mse(const VectorXf &y, const VectorXf &yhat, VectorXf &loss, const vector< float > &class_weights)
mean squared error
< nsga2 selection operator for getting the front
Namespace containing scoring functions for evaluation metrics.
vector< float > class_weights
weights for each class