Classification multiclasse

Introduction au Deep Learning avec Keras

Miguel Esteban

Data Scientist & Founder

Lancer de fléchettes

Introduction au Deep Learning avec Keras

Le jeu de données

Introduction au Deep Learning avec Keras

Le jeu de données

Introduction au Deep Learning avec Keras

L'architecture

Introduction au Deep Learning avec Keras

L'architecture

Introduction au Deep Learning avec Keras

L'architecture

Introduction au Deep Learning avec Keras

La couche de sortie

Introduction au Deep Learning avec Keras

Modèle 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')
Introduction au Deep Learning avec Keras

Entropie croisée catégorielle

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

Introduction au Deep Learning avec Keras

Préparer un jeu de données

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)
Introduction au Deep Learning avec Keras

One-hot encoding

Introduction au Deep Learning avec Keras

Passons à la pratique !

Introduction au Deep Learning avec Keras

Preparing Video For Download...