3. Choose the operation you need
You will learn: when to run, generate, predict, retrain, calibrate or inspect. Start from what you already have.
I have measurements and want a model
Use run. It fits candidates, evaluates them, selects one and creates the final predictor. Start with 1. Run your first complete experiment, then add nodes in 5. Build a pipeline you can explain.
Python SDK calls nirs4all.run(pipeline, dataset, ...). The shared finite native recipe uses Python Core run_pipeline(data, recipe), R nirs4all_run_pipeline, Octave nirs4all.runPipeline, or WASM runBrowserPipeline. Real calls appear together in 10. Run the same recipe in your language.
I want to see which recipes will be tried
Use a generator, which expands choices without fitting. Two preprocessing choices and three component counts make six recipes. Inspect the list before launching 18 fold fits. See the generator node.
A candidate list handles a small comparison. Tuning asks an optimizer to propose settings within a budget. Resume restores a saved compatible search; changing data or search settings starts a different experiment. Begin with fixed alternatives before structural tuning.
I have a saved model and new measurements
Use predict. Reload the predictor, pass raw measurements in the same feature/source order, and keep IDs beside the predicted values. New measurements need no labels. Follow 8. Save a predictor and use it on new observations.
I have new labeled data
Use retrain to build another predictor. Refit uses the selected recipe on its complete original training data; retraining starts a new campaign with new training data. Continuing old neural-network weights is a separate, model-specific option.
I need uncertainty intervals
Use calibrate after fixing the predictor. Predict a separate labeled calibration cohort and learn an allowance from its errors. Future predictions can include intervals. See 6. Measure whether your model answers the question.
I want to compare completed experiments
Open results or a workspace, without starting another fit. Compare held-out scores only when target, units, data and validation protocol match. See 7. Read the result and keep a useful experiment record.
Operation |
Needed input |
Output |
Example or explanation |
|---|---|---|---|
Generate |
Recipe with choices |
Candidate recipes |
|
Run |
Training data and recipe |
Scores, winner and predictor |
|
Tune/resume |
Data, space and budget/checkpoint |
Trials and selected predictor |
|
Predict |
Fitted predictor and compatible X |
Estimates and sample IDs |
|
Retrain |
New labeled data and recipe/source model |
New experiment |
|
Calibrate |
Fixed predictor and separate labels |
Calibration state and intervals |
|
Export/load |
Completed model or experiment |
Durable artifact/reloaded object |
|
Inspect/compare |
Saved scores and predictions |
Tables and diagnostic figures |
|
Audit robustness |
Fixed predictor and defined perturbations |
Measured performance changes |
Which settings change the scientific answer?
Setting family |
Examples |
Why it matters |
|---|---|---|
Data |
Targets, sources, groups, partitions |
Defines the scientific question |
Recipe |
Transform order, model, branch/merge |
Defines the relation you learn |
Evaluation |
Folds, metric and aggregation |
Defines what a score means |
Search |
Alternatives, budget, seed |
Defines competing recipes |
Execution |
Engine and installed runtime |
Defines executable operations |
Storage |
Workspace/export destination |
Defines what can be inspected or reloaded |
Display |
Figure visibility and labels |
Helps interpretation |
The CLI uses groups such as workflow, results, tuning, dataset and workspace; exact flags are in CLI reference.
Checkpoint: “saved model and unlabeled measurements” means load → predict. “Two possible recipes” means compare on shared folds. Continue to 4. Describe your measurements and align your sources.