Classification binaire

Introduction au Deep Learning avec Keras

Miguel Esteban

Data Scientist & Founder

Quand utiliser la classification binaire ?

Introduction au Deep Learning avec Keras

Notre jeu de données

Introduction au Deep Learning avec Keras

Pairplots

import seaborn as sns

# Plot a pairplot
sns.pairplot(circles, hue="target")

Introduction au Deep Learning avec Keras

Introduction au Deep Learning avec Keras

Introduction au Deep Learning avec Keras

Introduction au Deep Learning avec Keras

Introduction au Deep Learning avec Keras

Introduction au Deep Learning avec Keras

La fonction sigmoïde

Introduction au Deep Learning avec Keras

Construisons-le

from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense

# Instantiate a sequential model model = Sequential()

Introduction au Deep Learning avec Keras

Construisons-le

from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense

# Instantiate a sequential model model = Sequential()
# Add input and hidden layer model.add(Dense(4, input_shape=(2,), activation='tanh'))

Introduction au Deep Learning avec Keras

Construisons-le

from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense

# Instantiate a sequential model model = Sequential()
# Add input and hidden layer model.add(Dense(4, input_shape=(2,), activation='tanh'))
# Add output layer, use sigmoid model.add(Dense(1, activation='sigmoid'))

Introduction au Deep Learning avec Keras

Compilation, apprentissage, prédiction

# Compile model
model.compile(optimizer='sgd',
              loss='binary_crossentropy')

# Train model model.train(coordinates, labels, epochs=20)
# Predict with trained model preds = model.predict(coordinates)
Introduction au Deep Learning avec Keras

Introduction au Deep Learning avec Keras

Passons à la pratique !

Introduction au Deep Learning avec Keras

Preparing Video For Download...