Scikit-learn
What is Scikit-learn?
Scikit-learn is a machine learning library for Python.
It already contains several Machine Learning algorithms.
No need to write the AI algorithms.
It is fully integrated with Numpy and Pandas.
Scikit-learn code example
x
import numpy as np
import pandas as pd
# Using KNN classifier
from sklern.neighbors import KneighborsClassifier
knn=KneighborsClassifier(n_neighbors=3)
#importing the data for sorting
df=pd.read_csv("valente.csv")
# training data
X=df.ix[:,0:4].values
# target classes
y=df[[`target`]].values.ravel()
# teaching the machine.
knn.fit(X,y)
# rate an item
knn.predict([[6.5, 5.5, 4.5, 1.3]])
Rate another item
knn.predict([[1.5, 2.5, 2.0, 0.3]])
import pandas as pd
# Using KNN classifier
from sklern.neighbors import KneighborsClassifier
knn=KneighborsClassifier(n_neighbors=3)
#importing the data for sorting
df=pd.read_csv("valente.csv")
# training data
X=df.ix[:,0:4].values
# target classes
y=df[[`target`]].values.ravel()
# teaching the machine.
knn.fit(X,y)
# rate an item
knn.predict([[6.5, 5.5, 4.5, 1.3]])
Rate another item
knn.predict([[1.5, 2.5, 2.0, 0.3]])
How installing SKLEARN on UBUNTU?
To install SKLEARN on PIP3:
x
$ sudo pip3 install scikit-learn
# or
$ pip3 install -U scikit-learn
# or
$ pip3 install sklearn
# or
$ pip3 install -U scikit-learn
# or
$ pip3 install sklearn
To install SKLEARN on PIP:
x
$ sudo pip install scikit-learn
To install Python 2 on Linux:
x
$ sudo apt-get install python-sklearn
To install Python 3 on Linux
x
$ sudo apt install python3-sklearn
To installSKLern on Win use:
x
$ pip install -U scikit-learn
Note: SKLern is an abbreviation for scikit-learn.