Regression is a technique for investigating the relationship between independent variables or features and a dependent variable or outcome. It's used as a method for predictive modelling in machine learning, in which an algorithm is used to predict continuous outcomes.
Solving regression problems is one of the most common applications for machine learning models, especially in supervised machine learning. Algorithms are trained to understand the relationship between independent variables and an outcome or dependent variable. The model can then be leveraged to predict the outcome of new and unseen input data, or to fill a gap in missing data.
Regression analysis is an integral part of any forecasting or predictive model, so is a common method found in machine learning powered predictive analytics. Alongside classification, regression is a common use for supervised machine learning models. This approach to training models required labelled input and output training data. Machine learning regression models need to understand the relationship between features and outcome variables, so accurately labelled training data is vital.
The .csv data is loaded along with required modules, like sklearn and seaborn, etc.
The data is pre-processed by removing NULL values and unrequired data.
The training data is then split into two, Test and training data in a ratio.
Linear and Lasso Regression is applied on training data.
The new data is feed to the regression resulting in a prediction with certain accuracy.
The test results in accurate prediction of car price on the bases of factors given to the car i.e. Fuel type, distance traveled, seats, etc.
R squared error in training and testing : 0.03