CLI Reference¶
Complete reference for all Pilz command-line commands.
Commands Overview¶
Global Options¶
Every command accepts the standard Typer options:
| Option | Description |
|---|---|
--help |
Show the help message and exit |
--install-completion |
Install completion for the current shell |
--show-completion |
Show completion for the current shell, to copy it or customize the installation |
train¶
Train Pilz models for every target value in the datacard.
Options¶
| Option | Description |
|---|---|
--datacard |
Path to DataCard YAML file |
--trainsettings |
Path to TrainSettings YAML file |
Example¶
eval¶
Evaluate trained models and generate ROC plots and metrics.
Options¶
| Option | Description |
|---|---|
--datacard |
Path to DataCard YAML file |
--evalsettings |
Path to EvalSettings YAML file |
Example¶
Output Files¶
eval writes scores and plots. It does not emit SQL rules or predictions as SQL.
{target}_roc.html- ROC curve per target value; always written unlessinferis usedall_roc.html- Combined ROC curves; only when not usinginfermulti_class_result.html- Per-class accuracy; only for multi-class targets (len(target.values) > 1) and not usinginfer{out_file}- Prediction scores (CSV/Parquet); only when theout_filesetting is set
infer¶
Apply trained models to new data and write the predictions.
Unlike eval, no plots or accuracy metrics are produced, only the predicted scores (and, for multi-class targets, the predicted label). No HTML files are written; {out_file} is written when the out_file setting is set.
Options¶
| Option | Description |
|---|---|
--datacard |
Path to DataCard YAML file |
--evalsettings |
Path to EvalSettings YAML file |
Example¶
Use Cases¶
- Fast prediction on new data
- Batch scoring in production
- When you only need scores, not metrics
create-dc¶
Interactively generate a datacard YAML from a source data file.
Options¶
| Option | Description |
|---|---|
--src |
Path to the source data file (CSV or Parquet) |
--out |
Path where the generated datacard YAML is written (prompted if omitted) |
Example¶
Interactive Prompts¶
- Prompts for the target column until a valid column name is entered
- Derives each feature's
typeandstatisticalautomatically from the column dtype (no user prompt) - Prompts once for a replacement
missing_valuefor any column containing nulls or floatNaN - Prompts for "Infos about the dataset" and writes the answer as
infos: {bla: <answer>}
convert¶
Rewrite legacy cut-string trees to the compact structured form.
Trees trained before the structured cond representation stored every leaf condition as rendered SQL text; fan-out trees could reach megabyte-sized leaves. This command parses each condition back into the structured cond form and writes the trees to out. Tree structure and leaf scores are unchanged, so eval results are identical — only evaluation becomes fast.
Options¶
| Option | Description |
|---|---|
--src |
Path to the folder holding the trained trees (one sub-folder per target) |
--out |
Path where the migrated trees are written (prompted if omitted) |
Example¶
Quick Reference¶
| Command | Purpose |
|---|---|
pilz train --datacard X --trainsettings Y |
Train models |
pilz eval --datacard X --evalsettings Y |
Evaluate with metrics |
pilz infer --datacard X --evalsettings Y |
Fast predictions |
pilz create-dc --src X --out Y |
Generate DataCard |
pilz convert --src X --out Y |
Migrate legacy trees |