LoginSignup
0
1

More than 3 years have passed since last update.

初心者 最小コードで学ぶ機械学習

Last updated at Posted at 2018-11-12

機械学習わからなすぎるから、
グーグルのチュートリアル
コラボトリーで限界までまとめたったでぇ

アップルは0でオレンジが1という想定で学習させる

tensorflow.py
from sklearn import tree# 学習機能を入れる

       #  [重さg , 1は滑らか0はゴツゴツ]
features = [[140, 1], [130, 1], [150, 0], [170, 0]]  # 学習材料設定
      #[ここでは0はアップルで1はオレンジ]上の値に対しての答えを入れてく
labels = [0, 0, 1, 1]# 学習の答え設定


clf = tree.DecisionTreeClassifier()  # 学習方法設定
clf = clf.fit(features, labels)  # 学習

      #  [重さ160gで0はゴツゴツ]なのでオレンジ
print clf.predict([[160, 0]]) # 推定したいデータ入力

[1]

結果はオレンジっていうのがGOOGLE MLの最初のやつ

詳細はGOOGLE MLの動画で

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1