How to Make Predictions with scikit-learn
Last Updated on January 10, 2020
How to predict classification or regression outcomes
with scikit-learn models in Python.
Once you choose and fit a final machine learning model in scikit-learn, you can use it to make predictions on new data instances.
There is some confusion amongst beginners about how exactly to do this. I often see questions such as:
How do I make predictions with my model in scikit-learn?
In this tutorial, you will discover exactly how you can make classification and regression predictions with a finalized machine learning model in the scikit-learn Python library.
After completing this tutorial, you will know:
- How to finalize a model in order to make it ready for making predictions.
- How to make class and probability predictions in scikit-learn.
- How to make regression predictions in scikit-learn.
Kick-start your project with my new book Machine Learning Mastery With Python, including step-by-step tutorials and the Python source code files for all examples.
Let’s get started.
- Updated Jan/2020: Updated for changes in scikit-learn v0.22 API.