Phân loại đa lớp

Nhập môn Deep Learning với Keras

Miguel Esteban

Data Scientist & Founder

Ném phi tiêu

Nhập môn Deep Learning với Keras

Bộ dữ liệu

Nhập môn Deep Learning với Keras

Bộ dữ liệu

Nhập môn Deep Learning với Keras

Kiến trúc mô hình

Nhập môn Deep Learning với Keras

Kiến trúc mô hình

Nhập môn Deep Learning với Keras

Kiến trúc mô hình

Nhập môn Deep Learning với Keras

Lớp đầu ra

Nhập môn Deep Learning với Keras

Mô hình đa lớp

# Instantiate a sequential model
# ...

# Add an input and hidden layer # ...
# Add more hidden layers # ...
# Add your output layer model.add(Dense(4, activation='softmax')
Nhập môn Deep Learning với Keras

Cross-entropy phân loại

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

Nhập môn Deep Learning với Keras

Chuẩn bị dữ liệu

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)
Nhập môn Deep Learning với Keras

One-hot encoding

Nhập môn Deep Learning với Keras

Ayo berlatih!

Nhập môn Deep Learning với Keras

Preparing Video For Download...