Skip to content

Commit 22dcfcd

Browse files
Copilotthinkall
andauthored
Add comprehensive metric documentation and URL reference to AutoML docstrings (#1471)
* Initial plan * Update AutoML metric documentation with full list and documentation link Co-authored-by: thinkall <3197038+thinkall@users.noreply.github.com> * Apply black and mdformat formatting to code and documentation Co-authored-by: thinkall <3197038+thinkall@users.noreply.github.com> * Apply pre-commit formatting fixes Co-authored-by: thinkall <3197038+thinkall@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: thinkall <3197038+thinkall@users.noreply.github.com> Co-authored-by: Li Jiang <bnujli@gmail.com>
1 parent d7208b3 commit 22dcfcd

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

flaml/automl/automl.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ def __init__(self, **settings):
118118
e.g., 'accuracy', 'roc_auc', 'roc_auc_ovr', 'roc_auc_ovo', 'roc_auc_weighted',
119119
'roc_auc_ovo_weighted', 'roc_auc_ovr_weighted', 'f1', 'micro_f1', 'macro_f1',
120120
'log_loss', 'mae', 'mse', 'r2', 'mape'. Default is 'auto'.
121+
For a full list of supported built-in metrics, please refer to
122+
https://microsoft.github.io/FLAML/docs/Use-Cases/Task-Oriented-AutoML#optimization-metric
121123
If passing a customized metric function, the function needs to
122124
have the following input arguments:
123125
@@ -1765,6 +1767,8 @@ def fit(
17651767
e.g., 'accuracy', 'roc_auc', 'roc_auc_ovr', 'roc_auc_ovo', 'roc_auc_weighted',
17661768
'roc_auc_ovo_weighted', 'roc_auc_ovr_weighted', 'f1', 'micro_f1', 'macro_f1',
17671769
'log_loss', 'mae', 'mse', 'r2', 'mape'. Default is 'auto'.
1770+
For a full list of supported built-in metrics, please refer to
1771+
https://microsoft.github.io/FLAML/docs/Use-Cases/Task-Oriented-AutoML#optimization-metric
17681772
If passing a customized metric function, the function needs to
17691773
have the following input arguments:
17701774

website/docs/Use-Cases/Task-Oriented-AutoML.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ If users provide the minimal inputs only, `AutoML` uses the default settings for
5151
The optimization metric is specified via the `metric` argument. It can be either a string which refers to a built-in metric, or a user-defined function.
5252

5353
- Built-in metric.
54+
5455
- 'accuracy': 1 - accuracy as the corresponding metric to minimize.
5556
- 'log_loss': default metric for multiclass classification.
5657
- 'r2': 1 - r2_score as the corresponding metric to minimize. Default metric for regression.
@@ -70,6 +71,40 @@ The optimization metric is specified via the `metric` argument. It can be either
7071
- 'ap': minimize 1 - average_precision_score.
7172
- 'ndcg': minimize 1 - ndcg_score.
7273
- 'ndcg@k': minimize 1 - ndcg_score@k. k is an integer.
74+
- 'pr_auc': minimize 1 - precision-recall AUC score. (Spark-specific)
75+
- 'var': minimize variance. (Spark-specific)
76+
77+
- Built-in HuggingFace metrics (for NLP tasks).
78+
79+
- 'accuracy': minimize 1 - accuracy.
80+
- 'bertscore': minimize 1 - BERTScore.
81+
- 'bleu': minimize 1 - BLEU score.
82+
- 'bleurt': minimize 1 - BLEURT score.
83+
- 'cer': minimize character error rate.
84+
- 'chrf': minimize ChrF score.
85+
- 'code_eval': minimize 1 - code evaluation score.
86+
- 'comet': minimize 1 - COMET score.
87+
- 'competition_math': minimize 1 - competition math score.
88+
- 'coval': minimize 1 - CoVal score.
89+
- 'cuad': minimize 1 - CUAD score.
90+
- 'f1': minimize 1 - F1 score.
91+
- 'gleu': minimize 1 - GLEU score.
92+
- 'google_bleu': minimize 1 - Google BLEU score.
93+
- 'matthews_correlation': minimize 1 - Matthews correlation coefficient.
94+
- 'meteor': minimize 1 - METEOR score.
95+
- 'pearsonr': minimize 1 - Pearson correlation coefficient.
96+
- 'precision': minimize 1 - precision.
97+
- 'recall': minimize 1 - recall.
98+
- 'rouge': minimize 1 - ROUGE score.
99+
- 'rouge1': minimize 1 - ROUGE-1 score.
100+
- 'rouge2': minimize 1 - ROUGE-2 score.
101+
- 'sacrebleu': minimize 1 - SacreBLEU score.
102+
- 'sari': minimize 1 - SARI score.
103+
- 'seqeval': minimize 1 - SeqEval score.
104+
- 'spearmanr': minimize 1 - Spearman correlation coefficient.
105+
- 'ter': minimize translation error rate.
106+
- 'wer': minimize word error rate.
107+
73108
- User-defined function.
74109
A customized metric function that requires the following (input) signature, and returns the input config’s value in terms of the metric you want to minimize, and a dictionary of auxiliary information at your choice:
75110

0 commit comments

Comments
 (0)