LoslegenKostenlos starten

Plot losses

Once we've fit a model, we usually check the training loss curve to make sure it's flattened out. The history returned from model.fit() is a dictionary that has an entry, 'loss', which is the training loss. We want to ensure this has more or less flattened out at the end of our training.

Diese Übung ist Teil des Kurses

<Kurs>Machine Learning for Finance in Python</Kurs>
Kurs ansehen

Übungsanweisungen

  • Plot the losses ('loss') from history.history.
  • Set the title of the plot as the last loss from history.history, and round it to 6 digits.

Interaktive praktische Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Plot the losses from the fit
plt.plot(____)

# Use the last loss as the title
plt.title('loss:' + str(round(____, 6)))
plt.show()
Code bearbeiten und ausführen