Brush C++ API
A flexible interpretable machine learning framework
Loading...
Searching...
No Matches
Brush::Eval Namespace Reference

Classes

class  Evaluation
 Class for evaluating the fitness of individuals in a population. More...
 
class  Scorer
 
class  Scorer< P >
 

Functions

float mse (const VectorXf &y, const VectorXf &yhat, VectorXf &loss, const vector< float > &class_weights)
 mean squared error
 
VectorXf log_loss (const VectorXf &y, const VectorXf &predict_proba, const vector< float > &class_weights=vector< float >())
 Calculates the log loss between the predicted probabilities and the true labels.
 
float mean_log_loss (const VectorXf &y, const VectorXf &predict_proba, VectorXf &loss, const vector< float > &class_weights)
 log loss
 
float average_precision_score (const VectorXf &y, const VectorXf &predict_proba, VectorXf &loss, const vector< float > &class_weights=vector< float >())
 Calculates the average precision score between the predicted probabilities and the true labels.
 
VectorXf multi_log_loss (const VectorXf &y, const ArrayXXf &predict_proba, const vector< float > &class_weights=vector< float >())
 Calculates the multinomial log loss between the predicted probabilities and the true labels.
 
float mean_multi_log_loss (const VectorXf &y, const ArrayXXf &predict_proba, VectorXf &loss, const vector< float > &class_weights=vector< float >())
 Calculates the mean multinomial log loss between the predicted probabilities and the true labels.
 

Function Documentation

◆ average_precision_score()

float Brush::Eval::average_precision_score ( const VectorXf & y,
const VectorXf & predict_proba,
VectorXf & loss,
const vector< float > & class_weights = vector< float >() )

Calculates the average precision score between the predicted probabilities and the true labels.

Parameters
yThe true labels.
predict_probaThe predicted probabilities.
lossReference to store the calculated losses for each sample.
class_weightsThe optional class weights.
Returns
The average precision score.

Definition at line 59 of file metrics.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ log_loss()

VectorXf Brush::Eval::log_loss ( const VectorXf & y,
const VectorXf & predict_proba,
const vector< float > & class_weights = vector< float >() )

Calculates the log loss between the predicted probabilities and the true labels.

Parameters
yThe true labels.
predict_probaThe predicted probabilities.
class_weightsThe optional class weights.
Returns
The log loss.

Definition at line 16 of file metrics.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mean_log_loss()

float Brush::Eval::mean_log_loss ( const VectorXf & y,
const VectorXf & predict_proba,
VectorXf & loss,
const vector< float > & class_weights = vector< float >() )

log loss

Calculates the mean log loss between the predicted probabilities and the true labels.

Parameters
yThe true labels.
predict_probaThe predicted probabilities.
lossReference to store the calculated losses for each sample.
class_weightsThe optional class weights.
Returns
The mean log loss.

Definition at line 51 of file metrics.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mean_multi_log_loss()

float Brush::Eval::mean_multi_log_loss ( const VectorXf & y,
const ArrayXXf & predict_proba,
VectorXf & loss,
const vector< float > & class_weights = vector< float >() )

Calculates the mean multinomial log loss between the predicted probabilities and the true labels.

Parameters
yThe true labels.
predict_probaThe predicted probabilities.
lossReference to store the calculated losses for each sample.
class_weightsThe optional class weights.
Returns
The mean multinomial log loss.

Definition at line 169 of file metrics.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mse()

float Brush::Eval::mse ( const VectorXf & y,
const VectorXf & yhat,
VectorXf & loss,
const vector< float > & class_weights = vector< float >() )

mean squared error

Calculates the mean squared error between the predicted values and the true values.

Parameters
yThe true values.
yhatThe predicted values.
lossReference to store the calculated losses for each sample.
class_weightsThe optional class weights (not used for MSE).
Returns
The mean squared error.

Definition at line 9 of file metrics.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ multi_log_loss()

VectorXf Brush::Eval::multi_log_loss ( const VectorXf & y,
const ArrayXXf & predict_proba,
const vector< float > & class_weights = vector< float >() )

Calculates the multinomial log loss between the predicted probabilities and the true labels.

Parameters
yThe true labels.
predict_probaThe predicted probabilities.
class_weightsThe optional class weights.
Returns
The multinomial log loss.

Definition at line 118 of file metrics.cpp.

Here is the caller graph for this function: