Multiklassklassificering

Introduktion till djupinlärning med Keras

Miguel Esteban

Data Scientist & Founder

Kasta pilar

Introduktion till djupinlärning med Keras

Datamängden

Introduktion till djupinlärning med Keras

Datamängden

Introduktion till djupinlärning med Keras

Arkitekturen

Introduktion till djupinlärning med Keras

Arkitekturen

Introduktion till djupinlärning med Keras

Arkitekturen

Introduktion till djupinlärning med Keras

Utdatalagret

Introduktion till djupinlärning med Keras

Multiklassmodell

# Instantiate a sequential model
# ...

# Add an input and hidden layer # ...
# Add more hidden layers # ...
# Add your output layer model.add(Dense(4, activation='softmax')
Introduktion till djupinlärning med Keras

Kategorisk korsentropi

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

Introduktion till djupinlärning med Keras

Förbereda en datamängd

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)
Introduktion till djupinlärning med Keras

One-hot-kodning

Introduktion till djupinlärning med Keras

Nu kör vi en övning!

Introduktion till djupinlärning med Keras

Preparing Video For Download...