R, Machine Learning, Nonlinear Regression.
significant. In this case, we can create a model for the first 5 degrees and interpret the results. model<-lm(medv~poly(lstat,5),data=train.data) predictions<-model %>% predict(test.data) data.frame( RMSE=RMSE(predictions,test.data$medv), R2=R2(predictions,test.data$medv) ) RMSE R2 1 4.96127