ax axhline(lw= ,color='black'ax set_xlabel('observed'ax set_ylabel('residuals'ax title set_text("residual plot with -squared={}format(np average( _score))plt show(the generated plot shows an -squared that is comparable to training performance the plot is shown in figure - figure - residual plot for test dataset it is clearly evident from our evaluation that the linear regression model is unable to model the data to generate decent results though it should be noted that the model is performing equally on both training and testing datasets it seems like case where we would need to model this data using methods that can model non-linear relationships exercise in this sectionwe used training and testing datasets with attributes (including both numeric and one hot encoded categoricalsthe performance is dismal due to non-linearity and other factors experiment with different combination of attributes (use only subset or use only numerical attributes or any combination of themand prepare different linear regression models follow the same steps as outlined in this section check the performance against the model prepared in this section and analyze if better performing model could be possible decision tree based regression decision trees are supervised learning algorithms used for both regression and classification problems they are simple yet powerful in modeling non-linear relationships being non-parametric modelthe aim of this algorithm is to learn model that can predict outcomes based on simple decision rules (for instanceif-else conditionsbased on features the interpretability of decision trees makes them even more lucrativeas we can visualize the rules it has inferred from the data