多クラス分類

Kerasで学ぶIntroduction to Deep Learning

Miguel Esteban

Data Scientist & Founder

ダーツを投げる

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

多クラスモデル

# Instantiate a sequential model
# ...

# Add an input and hidden layer # ...
# Add more hidden layers # ...
# Add your output layer model.add(Dense(4, activation='softmax')
Kerasで学ぶIntroduction to Deep Learning

カテゴリカル交差エントロピー

model.compile(optimizer='adam', loss='categorical_crossentropy')

Kerasで学ぶIntroduction to Deep Learning

データセットの準備

import pandas as pd
from tensorflow.keras.utils import to_categorical

# Load dataset
df = pd.read_csv('data.csv')

# Turn response variable into labeled codes df.response = pd.Categorical(df.response) df.response = df.response.cat.codes
# Turn response variable into one-hot response vector y = to_categorical(df.response)
Kerasで学ぶIntroduction to Deep Learning

ワンホットエンコーディング

Kerasで学ぶIntroduction to Deep Learning

練習しましょう!

Kerasで学ぶIntroduction to Deep Learning

Preparing Video For Download...