Horje
keras plot history Code Example
keras plot history
import keras
from matplotlib import pyplot as plt
history = model1.fit(train_x, train_y,validation_split = 0.1, epochs=50, batch_size=4)
plt.plot(history.history['acc'])
plt.plot(history.history['val_acc'])
plt.title('model accuracy')
plt.ylabel('accuracy')
plt.xlabel('epoch')
plt.legend(['train', 'val'], loc='upper left')
plt.show()
Plotting keras model trainning history
history = model.fit()
print(history.history.keys())

import matplotlib.pylab as plt
from matplotlib.pyplot import figure
figure(figsize=(8, 6))
plt.plot(history.history['loss'])
plt.plot(history.history['val_loss'])
plt.title('model loss')
plt.ylabel('loss')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper left')
plt.show()




Python

Related
difference between w+ and r+ in python Code Example difference between w+ and r+ in python Code Example
xlabel seaborn Code Example xlabel seaborn Code Example
tick labels vertical matplotlib Code Example tick labels vertical matplotlib Code Example
python get newest file in directory Code Example python get newest file in directory Code Example
download pdf from url python Code Example download pdf from url python Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7