6일차 요약
- 오전: Linear regression 실습
- 오후: Binary classification 실습
from tensorflow import keras
from keras import layers
model = keras.Sequential([
layers.Dense(units = 6, activation='relu', input_shape = (6,)),
layers.Dense(units=3, activation='relu'),
layers.Dense(units=1)
])

model.compile(
loss = 'mse',
optimizer = 'adam',
metrics = ['mse','mae']
)
EPOCHS = 100
BATCH_SIZE = 16
history = model.fit(
X_train_s,
y_train,
batch_size = BATCH_SIZE,
epochs=EPOCHS,
verbose=1
)
epochs = history.epoch
plt.plot(history.history['loss'])
plt.show()

from tensorflow import keras
from keras import layers
model = keras.Sequential([
layers.Dense(units = 3, activation='relu', input_shape = (8,)),
layers.Dense(units=2, activation='relu'),
layers.Dense(units=1, activation='sigmoid')
])
model.compile(
loss = 'binary_crossentropy',
optimizer = 'adam',
metrics=['accuracy']
)
EPOCHS = 100
BATCH_SIZE = 16
history = model.fit(
X_train_s,
y_train,
epochs = EPOCHS,
batch_size = BATCH_SIZE,
validation_split = 0.2,
verbose = 1
)