Evaluate Command - Evaluate trained models on test data via CLI.
Functions
parse_extra_args(args)
Parse unrecognised command-line arguments into a keyword dictionary.
Leading dashes are stripped from each flag name. A flag followed by a non-flag token takes that token as its value, coerced to
bool, int, or float when possible; a flag with no value becomes True.Parameters
args
list of str
Raw leftover tokens, typically
click.Context.args.
Returns
kwargs
dict
Mapping of flag name to parsed value.
tuiml evaluate [OPTIONS]
Score a trained model against labelled test data.
Loads a model by ID or file path, runs it over the given dataset, and prints the resulting metrics. With
--stage report it prints a per-class classification report instead of a flat table of scores. Metrics are chosen automatically from the model's task unless --metrics is given.Evaluate a saved model on a held-out CSV:
bash
$ tuiml evaluate --model-path model.pkl -d test.csv -t label
Ask for specific metrics and save the scores:
bash
$ tuiml evaluate --model-id abc123 -d test.csv -t label -m accuracy -m f1_score -o scores.json
Print a per-class classification report:
bash
$ tuiml evaluate --model-path model.pkl -d test.csv -t label --stage report
Options
--model-path
Path to a saved model file (alternative to --model-id).
--data, -d
Path to a test data file or a built-in dataset name.
--target, -t
Name of the target column holding the true labels or values.
--model-id
Model ID printed by "tuiml train" (alternative to --model-path).
--metrics, -m
repeatable
Metric to compute, by function name. Repeatable; defaults to metrics chosen for the task.
--output, -o
Write the full result record to this file as JSON.
--stage
Evaluation stage to run: 'metrics' for scores, or 'report' for a per-class text report.
--json-output
flag
Print the raw JSON result instead of the formatted summary.
--verbose, -v
flag
Echo the resolved configuration and re-raise full tracebacks on error.