Prediction and Model Reuse

Note

This page has been superseded by the consolidated Predictions documentation. Please refer to the new guides:

Quick Reference

The primary prediction workflows are:

Predict from an Exported Bundle

import nirs4all

# Train and export
result = nirs4all.run(pipeline, dataset)
result.export("model.n4a")

# Predict on new data
preds = nirs4all.predict(model="model.n4a", data=X_new)
print(preds.values)

Predict from a Chain ID

preds = nirs4all.predict(chain_id="abc123", data=X_new, workspace_path="workspace")

Transfer Learning

retrained = nirs4all.retrain(
    source="model.n4a",
    data=new_data,
    mode="transfer",
)

For the complete guide, see Predictions.

See also

Related Examples: