How to Install Scikit-learn

In the data science community, scikit-learn is the most widely used machine learning (ML) package. Scikit-learn is a powerful and easy-to-use tool for data processing and ML model implementation. There is scarcely a better tool to master the initial machine learning tasks if you are a data science enthusiast. In this tutorial we will learn how to install scikit-learn.

Let’s install scikit-learn:

  • On Windows using pip: You can download Python 64 bit from here.

After installation run the following command:

pip install -U scikit-learn

If you want to check the version of scikit-learn, use the below command:

python -m pip show scikit-learn

The minimum version of scikit-learn dependencies are the same as described above:

install scikit-learn
  • On Windows using conda: Python 64 bit can be downloaded from here.

Also, install conda using Anaconda or Miniconda from the link. The minimum requirements to install conda are:

  • Windows, macOS, or Linux
  • 400 MB space (to install Miniconda)
  • 32 or 64 bit computer
  • Minimum 3 GB space (to install Anaconda)

Then run:

conda install -c conda-forge scikit-learn

If you want to check the version of scikit-learn, use the below command:

conda list scikit-learn #tells about the version of scikit learn
conda list  #tells about packages installed on active conda env

The minimum version of the scikit-learn dependencies are the same as described above.

  • On MacOS using pip: You can install Python 3 from open source and free software Homebrew, or download & install it manually from the Python website.

After installation, run:

pip install -U scikit-learn

If you want to check the version of scikit-learn, use the below command:

python -m pip show scikit-learn  #to check version and path of scikit-learn
python -m pip freeze  #to check packages installed in the active virtualenv

The minimum version of the scikit-learn dependencies are the same as described above.

  • On MacOS using conda: You can install Python 3 from Homebrew or download & install it manually from the Python website.

Also, install conda using Anaconda or Miniconda from this link. The minimum requirements to install conda are:

  • 400 MB space to install Miniconda
  • Windows, macOS, or Linux
  • 32 or 64 bit computer
  • Minimum 3 GB space to download & install Anaconda

After installation, run:

conda install -c conda-forge scikit-learn

If you want to check the version of scikit-learn, use the below command:

conda list scikit-learn #tells about the version of scikit learn
conda list  #tells about packages installed on active conda env

The minimum version of the scikit-learn dependencies are the same as described above.

Summary

You need to start your ML journey somewhere and this is how you do it. Install the scikit-learn package and utilize it to take informed decisions based on data, fetch insights from data using scikit-learn library and to build powerful ML models.


References