Classificazione multiclasse

Introduzione al Deep Learning con Keras

Miguel Esteban

Data Scientist & Founder

Lancio di freccette

Introduzione al Deep Learning con Keras

Il dataset

Introduzione al Deep Learning con Keras

Il dataset

Introduzione al Deep Learning con Keras

L'architettura

Introduzione al Deep Learning con Keras

L'architettura

Introduzione al Deep Learning con Keras

L'architettura

Introduzione al Deep Learning con Keras

Il livello di output

Introduzione al Deep Learning con Keras

Modello multiclasse

# Instantiate a sequential model
# ...

# Add an input and hidden layer # ...
# Add more hidden layers # ...
# Add your output layer model.add(Dense(4, activation='softmax')
Introduzione al Deep Learning con Keras

Entropia incrociata categoriale

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

Introduzione al Deep Learning con Keras

Preparare un dataset

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)
Introduzione al Deep Learning con Keras

One-hot encoding

Introduzione al Deep Learning con Keras

Esercitiamoci!

Introduzione al Deep Learning con Keras

Preparing Video For Download...