Requirements :
Find 2 datasets, one for regression and the other for classification
Regression:
linear regression, polynomial regression(upto deg=3), random forest, SVM
Classification:
the other for classification using logistic regression, KNN, random forest, SVM
Project Requirements:
No. of rows >=1000
No. variables > 2
No. of classes for the dependent variable must be more than 2 for classification
Do K-fold cross-validation for both.
For regression show: R2, Adjusted R2, RMSE, correlation matrix, p-values of independent variables (codes 10)
For classification show: Accuracy, confusion matrix, (Macro recall and precision for multiclass Classification) (codes 10)
Do hyper-parameter tuning using Grid Search
The report should discuss the properties of the datasets, your results, and model performance comparisons, and inferences/conclusions. (10)
Prepare a report to discuss the properties of the datasets, your results, and inferences. (10)
Here solution of this which fulfill the above requirements :
Import Libraries
>>> import pandas as pd
>>> import numpy as np
>>> import matplotlib.pyplot as plt #Data visualization libraries
>>> import seaborn as sns
>>> %matplotlib inline
Load Data
![](https://static.wixstatic.com/media/90b6f2_8c287467c7134b3ca2224849ab69a36a~mv2.jpg/v1/fill/w_147,h_32,al_c,q_80,usm_0.66_1.00_0.01,blur_2,enc_auto/90b6f2_8c287467c7134b3ca2224849ab69a36a~mv2.jpg)
Creating methods to update columns fields values
![](https://static.wixstatic.com/media/90b6f2_c91f576159a241059a3794b37d3d3d90~mv2.jpg/v1/fill/w_147,h_62,al_c,q_80,usm_0.66_1.00_0.01,blur_2,enc_auto/90b6f2_c91f576159a241059a3794b37d3d3d90~mv2.jpg)
Applying these methods on pandas datasets to update values
![](https://static.wixstatic.com/media/90b6f2_4015503354d143998797bf35bc265e79~mv2.jpg/v1/fill/w_147,h_74,al_c,q_80,usm_0.66_1.00_0.01,blur_2,enc_auto/90b6f2_4015503354d143998797bf35bc265e79~mv2.jpg)
In the next steps are done logistic regression, if you need the complete solution with k fold to implement logistic regression classification then please contact us here or you can also comment in below comments section.