Logarithmic scale for a learning curve

I'm plotting the learning curve with Python with the following code:

import matplotlib.pyplot as plt
import seaborn as sns
import csv
import pandas as pd
sns.set(style='darkgrid')

# Increase the plot size and font size.
sns.set(font_scale=1.5)
plt.rcParams[figure.figsize] = (12,6)
plt.plot(lst, 'r')

plt.legend([Validation Loss])
# Label the plot.
plt.title(RNN deltat)
plt.xlabel(Epoch)
plt.ylabel(Loss) 

The curve looks like this:

The lecturer said better try it on a logarithmic scale. Can you please help to apply the logarithm here?

Topic loss plotting validation deep-learning python

Category Data Science


This is more of a programming question than a data science question and would therefore be better suited to the stackoverflow stackexchange. To change the y-axis from a linear scale to a logarithmic scale you can use matplotlib.pyplot.yscale function using "log" as the argument:

import matplotlib.pyplot as plt

plt.yscale("log")

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.