I have datas in two lists. One with the real ones (observed) and one with the predicted ones.
I wanna put it in a graph to get something with the two lists with different colors and the line between them but I don't get how to put the line in the graph even after all my researches.
Here is what I want it to look like.
For now, here's my code that shows the two lists. I don't get where to place my r_squared variable.
from sklearn.metrics import r2_score
import matplotlib.pyplot as plt
observed = [1, 4, 9]
predicted = [1.2, 4.1, 8.7]
r_squared = r2_score(observed, predicted)
plt.plot(observed, 'o', predicted, 'o')