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 zero_one_loss (const VectorXf &y, const VectorXf &predict_proba, VectorXf &loss, const vector< float > &class_weights=vector< float >())
 Accuracy for binary classification.
 
float bal_zero_one_loss (const VectorXf &y, const VectorXf &predict_proba, VectorXf &loss, const vector< float > &class_weights=vector< float >())
 Balanced accuracy for binary classification.
 
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.
 
float multi_zero_one_loss (const VectorXf &y, const ArrayXXf &predict_proba, VectorXf &loss, const vector< float > &class_weights=vector< float >())
 Accuracy for multi-classification.
 

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 124 of file metrics.cpp.

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

◆ bal_zero_one_loss()

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

Balanced accuracy for binary classification.

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

Definition at line 92 of file metrics.cpp.

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 17 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 43 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 253 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 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 202 of file metrics.cpp.

Here is the caller graph for this function:

◆ multi_zero_one_loss()

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

Accuracy for multi-classification.

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 accuracy in a one-vs-all schema.

Definition at line 264 of file metrics.cpp.

Here is the caller graph for this function:

◆ zero_one_loss()

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

Accuracy for binary classification.

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

Definition at line 71 of file metrics.cpp.

Here is the caller graph for this function: