Machine Learning / Deep Learning


2018年04月23日


Machine Learning

Colaboratory
https://colab.research.google.com/
https://colab.research.google.com/notebooks/welcome.ipynb

これから始める人の為のディープラーニング基礎講座
https://www.slideshare.net/NVIDIAJapan/ss-71043984
TensorFlowによるニューラルネットワーク入門
https://www.slideshare.net/enakai/tensorflow-69157740
TensorFlowで会話AIを作ってみた。
https://www.slideshare.net/tak9029/tensorflowai
ディープラーニングの最新動向
https://www.slideshare.net/pfi/ss-57087522

 

わかりやすい機械学習のサンプル(入り口)

Colaboratoryを使ったバージョン

https://colab.research.google.com/

LinearSVC と KNeighborsClassifier

Choosing the right estimator — scikit-learn 0.19.2 documentation
http://scikit-learn.org/stable/tutorial/machine_learning_map/index.html

 

LinearSVCバージョン

# Choosing the right estimator — scikit-learn 0.19.2 documentation
# http://scikit-learn.org/stable/tutorial/machine_learning_map/index.html

from sklearn.svm import LinearSVC
from sklearn.metrics import accuracy_score

# X , Y
learn_data = 
# X and Y
learn_label = [1, 0, 0, 1]

clf = LinearSVC()

clf.fit(learn_data, learn_label)

test_data = 
test_label = clf.predict(test_data)

print(test_data , "の予測結果:" ,  test_label)
print("正解率 = " , accuracy_score([1, 0, 0, 1], test_label))
 の予測結果: [1 0 0 0]
正解率 =  0.75

 

KNeighborsClassifierバージョン

# Choosing the right estimator — scikit-learn 0.19.2 documentation
# http://scikit-learn.org/stable/tutorial/machine_learning_map/index.html

from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import accuracy_score

# X , Y
learn_data = 
# X and Y
learn_label = [1, 0, 0, 1]

clf = KNeighborsClassifier(n_neighbors = 1)

clf.fit(learn_data, learn_label)

test_data = 
test_label = clf.predict(test_data)

print(test_data , "の予測結果:" ,  test_label)
print("正解率 = " , accuracy_score([1, 0, 0, 1], test_label))
 の予測結果: [1 0 0 1]
正解率 =  1.0


Archive