Classificação binária

Introdução ao Deep Learning com Keras

Miguel Esteban

Data Scientist & Founder

Quando usar classificação binária?

Introdução ao Deep Learning com Keras

Nosso conjunto de dados

Introdução ao Deep Learning com Keras

Pairplots

import seaborn as sns

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

Introdução ao Deep Learning com Keras

Introdução ao Deep Learning com Keras

Introdução ao Deep Learning com Keras

Introdução ao Deep Learning com Keras

Introdução ao Deep Learning com Keras

Introdução ao Deep Learning com Keras

A função sigmoide

Introdução ao Deep Learning com Keras

Vamos construir

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

# Instantiate a sequential model model = Sequential()

Introdução ao Deep Learning com Keras

Vamos construir

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'))

Introdução ao Deep Learning com Keras

Vamos construir

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'))

Introdução ao Deep Learning com Keras

Compilar, treinar, prever

# 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)
Introdução ao Deep Learning com Keras

Introdução ao Deep Learning com Keras

Vamos praticar!

Introdução ao Deep Learning com Keras

Preparing Video For Download...