简体   繁体   中英

Plot scatter with actual vs predicted values with seaborn

This is how data frame previsao3_df looks like:

在此处输入图片说明

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:

在此处输入图片说明

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

Thanks in advance!

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 ofregplot and I invite you to explore that by yourself to master the package.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM