@@ -2375,7 +2375,7 @@ def classifier_test_cli(
2375
2375
predictions , reference_profile ["height" ], reference_profile ["width" ], nodata_mask
2376
2376
)
2377
2377
2378
- metrics_dict = score_predictions (y , predictions , get_enum_values (test_metrics ))
2378
+ metrics_dict = score_predictions (y , predictions , get_enum_values (test_metrics ), decimals = 3 )
2379
2379
typer .echo ("Progress: 80%" )
2380
2380
2381
2381
out_profile = reference_profile .copy ()
@@ -2421,7 +2421,7 @@ def regressor_test_cli(
2421
2421
predictions , reference_profile ["height" ], reference_profile ["width" ], nodata_mask
2422
2422
)
2423
2423
2424
- metrics_dict = score_predictions (y , predictions , get_enum_values (test_metrics ))
2424
+ metrics_dict = score_predictions (y , predictions , get_enum_values (test_metrics ), decimals = 3 )
2425
2425
typer .echo ("Progress: 80%" )
2426
2426
2427
2427
out_profile = reference_profile .copy ()
@@ -3109,7 +3109,7 @@ def summarize_probability_metrics_cli(true_labels: INPUT_FILE_OPTION, probabilit
3109
3109
(y_prob , y_true ), _ , _ = read_data_for_evaluation ([probabilities , true_labels ])
3110
3110
typer .echo ("Progress: 25%" )
3111
3111
3112
- results_dict = summarize_probability_metrics (y_true = y_true , y_prob = y_prob )
3112
+ results_dict = summarize_probability_metrics (y_true = y_true , y_prob = y_prob , decimals = 3 )
3113
3113
3114
3114
typer .echo ("Progress: 75%" )
3115
3115
@@ -3135,7 +3135,7 @@ def summarize_label_metrics_binary_cli(true_labels: INPUT_FILE_OPTION, predictio
3135
3135
(y_pred , y_true ), _ , _ = read_data_for_evaluation ([predictions , true_labels ])
3136
3136
typer .echo ("Progress: 25%" )
3137
3137
3138
- results_dict = summarize_label_metrics_binary (y_true = y_true , y_pred = y_pred )
3138
+ results_dict = summarize_label_metrics_binary (y_true = y_true , y_pred = y_pred , decimals = 3 )
3139
3139
typer .echo ("Progress: 75%" )
3140
3140
3141
3141
typer .echo ("Progress: 100% \n " )
@@ -3340,6 +3340,7 @@ def score_predictions_cli(
3340
3340
true_labels : INPUT_FILE_OPTION ,
3341
3341
predictions : INPUT_FILE_OPTION ,
3342
3342
metrics : Annotated [List [str ], typer .Option ()],
3343
+ decimals : Optional [int ] = None ,
3343
3344
):
3344
3345
"""Score predictions."""
3345
3346
from eis_toolkit .evaluation .scoring import score_predictions
@@ -3350,7 +3351,7 @@ def score_predictions_cli(
3350
3351
(y_pred , y_true ), _ , _ = read_data_for_evaluation ([predictions , true_labels ])
3351
3352
typer .echo ("Progress: 25%" )
3352
3353
3353
- outputs = score_predictions (y_true , y_pred , metrics )
3354
+ outputs = score_predictions (y_true , y_pred , metrics , decimals )
3354
3355
typer .echo ("Progress: 100% \n " )
3355
3356
3356
3357
typer .echo (f"Results: { str (outputs )} " )
0 commit comments