Basics of scikit-learn
Now, let's focus on scikit-learn, an essential ML library for Python. It implements dozens of classic ML models, but also numerous tools to help you while training them, such as pre-processing methods and cross-validation.
The first thing you must do to get started is install it in your Python environment:
$ pip install scikit-learn
We can now start our scikit-learn journey!
Training models and predicting
In scikit-learn, ML models and algorithms are called estimators. Each is a Python class that implements the same methods. In particular, we have fit
, which is used to train a model, and predict
, which is used to run the trained model on new data.
To try this, we'll load a sample dataset. scikit-learn comes with a few toy datasets that are very useful for performing experiments. You can find out more about them in the official documentation: https://scikit-learn.org/stable/datasets.html.
Here, we'll use the digits dataset,...