scikit-learn 1 · Evaluation and tuning
Save and load a model
Persist a fitted model or pipeline with joblib. Only load files you trust.
import joblib
joblib.dump(model, "model.joblib")
loaded = joblib.load("model.joblib")
Caution: Loading a joblib or pickle file can run arbitrary code. Never load one from an untrusted source.
Official scikit-learn 1 documentation
More evaluation and tuning commands
- Measure accuracy
- Get precision, recall and F1
- See where the model is wrong
- Evaluate a regression model
- Cross-validate
- Tune hyperparameters
All evaluation and tuning commands · scikit-learn 1 cheatsheet