For a linear regression model that I conducted, I'd like to review the regression plot of results. But since I have an input of size 6 parameters and target (output therefore) of 4, I get error when I use this code : source code

pyplot.scatter(x_train, y_train)
pyplot.plot(np.sort(x_values, axis=0,prediction)
  • $\begingroup$ You want to scatter data with more than 3 dimensions?? $\endgroup$ – Andreas Look Jul 12 '18 at 11:05
  • $\begingroup$ @AndreasLook No but there should be a measure of correctness of the regression analysis at the end $\endgroup$ – FabioSpaghetti Jul 12 '18 at 11:28
  • $\begingroup$ You can use different plot for each target. $\endgroup$ – Ankit Seth Jul 12 '18 at 11:41

You can plot your residuals. I am sorry I can't write it in Python but in R you would do it like this:


This will give you a scatterplot that you WANT to look like a null plot. Any curve or pattern in the points means that your model is not a good fit.

If you are interested in assessing each variable's prediction power I recommend (because you only have six) doing 1 regression model on each variable by itself and then plotting the residuals of those models, again looking for a null plot. You can also look at the correlation of each predictor variable vs your response variable. Those with higher correlation will be better predictors.

| improve this answer | |

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