Clasificare binară

Introducere în Deep Learning cu Keras

Miguel Esteban

Data Scientist & Founder

Când se utilizează clasificarea binară?

Introducere în Deep Learning cu Keras

Setul de date

Introducere în Deep Learning cu Keras

Pairplot-uri

import seaborn as sns

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

Introducere în Deep Learning cu Keras

Introducere în Deep Learning cu Keras

Introducere în Deep Learning cu Keras

Introducere în Deep Learning cu Keras

Introducere în Deep Learning cu Keras

Introducere în Deep Learning cu Keras

Funcția sigmoid

Introducere în Deep Learning cu Keras

Să construim modelul

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

# Instantiate a sequential model model = Sequential()

Introducere în Deep Learning cu Keras

Să construim modelul

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

Introducere în Deep Learning cu Keras

Să construim modelul

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

Introducere în Deep Learning cu Keras

Compilare, antrenare, predicție

# 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)
Introducere în Deep Learning cu Keras

Introducere în Deep Learning cu Keras

Să exersăm!

Introducere în Deep Learning cu Keras

Preparing Video For Download...