0
$\begingroup$

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: enter image description here

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

$\endgroup$

1 Answer 1

2
$\begingroup$

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")
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.