SKLearner Home | About | Contact | Examples

Import Scikit-Learn

Importing the scikit-learn library in Python is a straightforward process once you have it installed in your environment.

The import works in any Python script or interactive shell where scikit-learn is available.

import sklearn

You can also use the common alias sk for brevity:

import sklearn as sk

To confirm that scikit-learn is successfully imported and to check its version, you can print the __version__ attribute:

import sklearn
print(sklearn.__version__)

Running this code will output the version number:

1.5.0


See Also