二値分類

Kerasで学ぶIntroduction to Deep Learning

Miguel Esteban

Data Scientist & Founder

二値分類はいつ使う?

Kerasで学ぶIntroduction to Deep Learning

データセット

Kerasで学ぶIntroduction to Deep Learning

ペアプロット

import seaborn as sns

# Plot a pairplot
sns.pairplot(circles, hue="target")

Kerasで学ぶIntroduction to Deep Learning

Kerasで学ぶIntroduction to Deep Learning

Kerasで学ぶIntroduction to Deep Learning

Kerasで学ぶIntroduction to Deep Learning

Kerasで学ぶIntroduction to Deep Learning

Kerasで学ぶIntroduction to Deep Learning

シグモイド関数

Kerasで学ぶIntroduction to Deep Learning

作ってみましょう

from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense

# Instantiate a sequential model model = Sequential()

Kerasで学ぶIntroduction to Deep Learning

作ってみましょう

from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense

# Instantiate a sequential model model = Sequential()
# Add input and hidden layer model.add(Dense(4, input_shape=(2,), activation='tanh'))

Kerasで学ぶIntroduction to Deep Learning

作ってみましょう

from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense

# Instantiate a sequential model model = Sequential()
# Add input and hidden layer model.add(Dense(4, input_shape=(2,), activation='tanh'))
# Add output layer, use sigmoid model.add(Dense(1, activation='sigmoid'))

Kerasで学ぶIntroduction to Deep Learning

コンパイル、学習、予測

# Compile model
model.compile(optimizer='sgd',
              loss='binary_crossentropy')

# Train model model.train(coordinates, labels, epochs=20)
# Predict with trained model preds = model.predict(coordinates)
Kerasで学ぶIntroduction to Deep Learning

Kerasで学ぶIntroduction to Deep Learning

練習しましょう!

Kerasで学ぶIntroduction to Deep Learning

Preparing Video For Download...