R, Machine Learning, Nonlinear Regression.
%>% predict(test.data) data.frame( RMSE=RMSE(predictions,test.data$medv), R2=R2(predictions,test.data$medv) ) RMSE R2 1 5.243127 0.6565156 Thus, we obtained RMSE and R-squared values. Now let’s look at the regression line: ggplot(train.data, aes(lstat,medv))+ geom_point()+