|
Brush C++ API
A flexible interpretable machine learning framework
|
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. | |
| float | precision_score (const VectorXf &y, const VectorXf &predict_proba, VectorXf &loss, const vector< float > &class_weights=vector< float >()) |
| Precision for binary classification (threshold 0.5, positive label 1). | |
| float | recall_score (const VectorXf &y, const VectorXf &predict_proba, VectorXf &loss, const vector< float > &class_weights=vector< float >()) |
| Recall for binary classification (threshold 0.5, positive label 1). | |
| float | roc_auc_score (const VectorXf &y, const VectorXf &predict_proba, VectorXf &loss, const vector< float > &class_weights=vector< float >()) |
| Area under the ROC curve for binary classification. | |
| 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. | |
| float | multi_bal_zero_one_loss (const VectorXf &y, const ArrayXXf &predict_proba, VectorXf &loss, const vector< float > &class_weights=vector< float >()) |
| Balanced accuracy for multi-classification. | |
| float | multi_precision_score (const VectorXf &y, const ArrayXXf &predict_proba, VectorXf &loss, const vector< float > &class_weights=vector< float >()) |
| Macro-averaged precision for multi-classification. | |
| float | multi_recall_score (const VectorXf &y, const ArrayXXf &predict_proba, VectorXf &loss, const vector< float > &class_weights=vector< float >()) |
| Macro-averaged recall for multi-classification. | |
| float | multi_roc_auc_score (const VectorXf &y, const ArrayXXf &predict_proba, VectorXf &loss, const vector< float > &class_weights=vector< float >()) |
| Macro-averaged one-vs-rest AUROC for multi-classification. | |
| float | multi_average_precision_score (const VectorXf &y, const ArrayXXf &predict_proba, VectorXf &loss, const vector< float > &class_weights=vector< float >()) |
| Macro-averaged one-vs-rest average precision for multi-classification. | |
| 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.
| y | The true labels. |
| predict_proba | The predicted probabilities. |
| loss | Reference to store the calculated losses for each sample. |
| class_weights | The optional class weights. |
Definition at line 343 of file metrics.cpp.


| 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.
| y | The true labels. |
| predict_proba | The predicted probabilities. |
| loss | Reference to store the calculated losses for each sample. |
| class_weights | The optional class weights. |
Definition at line 102 of file metrics.cpp.


| 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.
| y | The true labels. |
| predict_proba | The predicted probabilities. |
| class_weights | The optional class weights. |
Definition at line 19 of file metrics.cpp.


| 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.
| y | The true labels. |
| predict_proba | The predicted probabilities. |
| loss | Reference to store the calculated losses for each sample. |
| class_weights | The optional class weights. |
Definition at line 47 of file metrics.cpp.


| 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.
| y | The true labels. |
| predict_proba | The predicted probabilities. |
| loss | Reference to store the calculated losses for each sample. |
| class_weights | The optional class weights. |
Definition at line 417 of file metrics.cpp.


| 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.
| y | The true values. |
| yhat | The predicted values. |
| loss | Reference to store the calculated losses for each sample. |
| class_weights | The optional class weights (not used for MSE). |
Definition at line 11 of file metrics.cpp.


| float Brush::Eval::multi_average_precision_score | ( | const VectorXf & | y, |
| const ArrayXXf & | predict_proba, | ||
| VectorXf & | loss, | ||
| const vector< float > & | class_weights = vector< float >() ) |
Macro-averaged one-vs-rest average precision for multi-classification.
Mean of the binary average precision of each class against the rest, skipping classes that are absent from y. The loss vector holds the per-sample multinomial log loss.
Definition at line 537 of file metrics.cpp.


| float Brush::Eval::multi_bal_zero_one_loss | ( | const VectorXf & | y, |
| const ArrayXXf & | predict_proba, | ||
| VectorXf & | loss, | ||
| const vector< float > & | class_weights ) |
Balanced accuracy for multi-classification.
Definition at line 465 of file metrics.cpp.


| 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.
| y | The true labels. |
| predict_proba | The predicted probabilities. |
| class_weights | The optional class weights. |
Definition at line 396 of file metrics.cpp.


| float Brush::Eval::multi_precision_score | ( | const VectorXf & | y, |
| const ArrayXXf & | predict_proba, | ||
| VectorXf & | loss, | ||
| const vector< float > & | class_weights = vector< float >() ) |
Macro-averaged precision for multi-classification.
Equivalent to sklearn's precision_score(average='macro', zero_division=0): averages over classes present in either the true or the predicted labels. The loss vector holds the misclassification indicator.
Definition at line 503 of file metrics.cpp.


| float Brush::Eval::multi_recall_score | ( | const VectorXf & | y, |
| const ArrayXXf & | predict_proba, | ||
| VectorXf & | loss, | ||
| const vector< float > & | class_weights = vector< float >() ) |
Macro-averaged recall for multi-classification.
Equivalent to sklearn's recall_score(average='macro', zero_division=0). The loss vector holds the misclassification indicator.
Definition at line 509 of file metrics.cpp.


| float Brush::Eval::multi_roc_auc_score | ( | const VectorXf & | y, |
| const ArrayXXf & | predict_proba, | ||
| VectorXf & | loss, | ||
| const vector< float > & | class_weights = vector< float >() ) |
Macro-averaged one-vs-rest AUROC for multi-classification.
Mean of the binary AUROC of each class against the rest, skipping classes that are absent from y. The loss vector holds the per-sample multinomial log loss.
Definition at line 515 of file metrics.cpp.


| 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.
| y | The true labels. |
| predict_proba | The predicted probabilities. |
| loss | Reference to store the calculated losses for each sample. |
| class_weights | The optional class weights. |
Definition at line 438 of file metrics.cpp.


| float Brush::Eval::precision_score | ( | const VectorXf & | y, |
| const VectorXf & | predict_proba, | ||
| VectorXf & | loss, | ||
| const vector< float > & | class_weights = vector< float >() ) |
Precision for binary classification (threshold 0.5, positive label 1).
Equivalent to sklearn's precision_score(zero_division=0). Class weights are used as sample weights. The loss vector holds the per-sample misclassification indicator (used in lexicase selection).
| y | The true labels. |
| predict_proba | The predicted probabilities. |
| loss | Reference to store the calculated losses for each sample. |
| class_weights | The optional class weights. |
Definition at line 360 of file metrics.cpp.


| float Brush::Eval::recall_score | ( | const VectorXf & | y, |
| const VectorXf & | predict_proba, | ||
| VectorXf & | loss, | ||
| const vector< float > & | class_weights = vector< float >() ) |
Recall for binary classification (threshold 0.5, positive label 1).
Equivalent to sklearn's recall_score(zero_division=0). The loss vector holds the per-sample misclassification indicator.
| y | The true labels. |
| predict_proba | The predicted probabilities. |
| loss | Reference to store the calculated losses for each sample. |
| class_weights | The optional class weights. |
Definition at line 374 of file metrics.cpp.


| float Brush::Eval::roc_auc_score | ( | const VectorXf & | y, |
| const VectorXf & | predict_proba, | ||
| VectorXf & | loss, | ||
| const vector< float > & | class_weights = vector< float >() ) |
Area under the ROC curve for binary classification.
Equivalent to sklearn's roc_auc_score. Returns 0.5 when only one class is present (where the metric is undefined). The loss vector holds the per-sample log loss (used in lexicase selection).
| y | The true labels. |
| predict_proba | The predicted probabilities. |
| loss | Reference to store the calculated losses for each sample. |
| class_weights | The optional class weights. |
Definition at line 386 of file metrics.cpp.


| 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.
| y | The true labels. |
| predict_proba | The predicted probabilities. |
| loss | Reference to store the calculated losses for each sample. |
| class_weights | The optional class weights. |
Definition at line 75 of file metrics.cpp.

