Clasificare multi-clasă

Introducere în Deep Learning cu Keras

Miguel Esteban

Data Scientist & Founder

Aruncarea săgeților

Introducere în Deep Learning cu Keras

Setul de date

Introducere în Deep Learning cu Keras

Setul de date

Introducere în Deep Learning cu Keras

Arhitectura

Introducere în Deep Learning cu Keras

Arhitectura

Introducere în Deep Learning cu Keras

Arhitectura

Introducere în Deep Learning cu Keras

Stratul de ieșire

Introducere în Deep Learning cu Keras

Model multi-clasă

# Instantiate a sequential model
# ...

# Add an input and hidden layer # ...
# Add more hidden layers # ...
# Add your output layer model.add(Dense(4, activation='softmax')
Introducere în Deep Learning cu Keras

Entropie încrucișată categorică

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

Introducere în Deep Learning cu Keras

Pregătirea unui set de date

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)
Introducere în Deep Learning cu Keras

Codificare one-hot

Introducere în Deep Learning cu Keras

Să exersăm!

Introducere în Deep Learning cu Keras

Preparing Video For Download...