unstuck
unstuck

Reputation: 650

Plot scatter with actual vs predicted values with seaborn

This is how data frame previsao3_df looks like:

enter image description here

I want to plot a scatter where the regression line is designed by the values of column "Previsão".

scatter_poly2 = sns.lmplot(
    data = previsao3_df, 
    x = "X",
    y = "y",
    order = 2
)

Is generating this plot:

enter image description here

Is there a way to feed the plot with the predicted values Previsão ?

Thanks in advance!

Upvotes: 1

Views: 6259

Answers (1)

I was doing this a few minutes ago: what you need is described in seaborn documentation. To solve your precise case simply:

sns.regplot(x="y", y="Previsão", data=previsao3_df);

And you will get the correlation between your model predictions and actual training/fitting data. Please notice that there are several options in the documentation of regplot and I invite you to explore that by yourself to master the package.

Upvotes: 0

Related Questions