Deep Learningについて、日本情報システム・ユーザー協会(JUAS)のJUAS ビジネスデータ研究会 AI分科会で発表しました。その際に使用した資料です。専門家向けではなく、一般向けの資料です。
なお本資料は、2015年12月の日本情報システム・ユーザー協会(JUAS)での発表資料の改訂版となります。
Deep Learningについて、日本情報システム・ユーザー協会(JUAS)のJUAS ビジネスデータ研究会 AI分科会で発表しました。その際に使用した資料です。専門家向けではなく、一般向けの資料です。
なお本資料は、2015年12月の日本情報システム・ユーザー協会(JUAS)での発表資料の改訂版となります。
The basics of Python are rather straightforward. In a few minutes you can learn most of the syntax. There are some gotchas along the way that might appear tricky. This talk is meant to bring programmers up to speed with Python. They should be able to read and write Python.
8. Scikit Learn 數字辨識步驟
1. Load data
2. Set a classifier
3. Learn a model
4. Predict the result
5. Evaluate
Cicilia Lee @ PyCon TW 2016
8
9. Scikit Learn 數字辨識 (1/3)
# Import datasets, classifiers and performance metrics
from sklearn import datasets, svm, metrics
### 1. Load data
# The digits dataset
digits = datasets.load_digits()
# To apply a classifier on this data, we need to flatten the image,
to
# turn the data in a (samples, feature) matrix:
n_samples = len(digits.images)
data = digits.images.reshape((n_samples, -1)) 9
Cicilia Lee @ PyCon TW 2016
10. Scikit Learn 數字辨識 (2/3)
### 2. Set a classifier
# Create a classifier: a support vector classifier
classifier = svm.SVC(gamma=0.001)
### 3. Learn a model
# We learn the digits on the first half of the digits
classifier.fit(data[:n_samples / 2],
digits.target[:n_samples / 2])
10
Cicilia Lee @ PyCon TW 2016
11. Scikit Learn 數字辨識 (3/3)
### 4. Predict the result
# Now predict the value of the digit on the second half:
expected = digits.target[n_samples / 2:]
predicted = classifier.predict(data[n_samples / 2:])
### 5. Evaluate
print("Classification report for classifier %s:n%sn"
% (classifier, metrics.classification_report(expected, predicted)))
print("Confusion matrix:n%s"
% metrics.confusion_matrix(expected, predicted))
11
Cicilia Lee @ PyCon TW 2016
14. 前處理
1. Clean data
2. Feature extraction
3. Convert category and string to number
4. Sparse data
5. Feature selection
14
Cicilia Lee @ PyCon TW 2016