专注细节
努力进步

01_setup_and_intrduction

Sklearn 学习笔记

numpy and scipy

  • pylab inline : Start pylab inline mode, so figures will appear in the notebook
  • In Ipython notebook, if you like to see the code, just load the .py
  • Serveral sparse formats: CSC, BSR, COO, DIA, DOK.

matplotlib

import matplotlib.pyplot as plt
– Plot a line: plt.plot(x,y)
– Scatter-plot points: plt.scatter(x,y)
– show images: plt.imshow(im); Contour plot: plt.contour(im)
– 3D plotting:
Other types in Matplotlib Homepage

An Overview of Scikit-learn

Skearn Turtorial
– svm in Sklearn
from sklearn import svm
from sklearn import datasets
digits = datasets.load_digits()
clf = svm.SVC(gamma=0.001, C=100)# define the model’s para
clf.fit(digits.data[:-1],digits.target[:-1])
clf.predict(digits.data[-1])
– Model Persistence

分享到:更多 ()