Introduction to Python packages – sklearn (scikit-learn)

First, let's look at the functions contained in the Python package called sklearn. The code has just three lines:

import sklearn as sk 
x=dir(sk) 
print(x) 

The related output is shown here:

For one specific submodule, it is called sklearn.cluster, as shown:

from sklearn import cluster 
x=dir(cluster) 
print(x) 

The output is shown here:

In addition, we can show many embedded datasets by using the following three lines of Python code:

import sklearn.datasets as datasets x=dir(datasets) print(x) ...

Get Hands-On Data Science with Anaconda now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.