7. Machine Learning - Develop machine learning model - Regression
7. Machine Learning - Develop machine learning model - Regression
You split your dataset into training and testing sets using the train_test_split function from Scikit-
learn.
Develop machine learning model
Model Building
As we know our target variable (selling_price) is continuous data, so we will use regression
technique. i.e.:
Linear Regression,
Random Forest Regressor,
Decision Tree Regressor, and
Support Vector Regressor (SVR).
We train each model using the training data and then test how well they could predict vehicle
prices using both the training and testing data.
We used metrics like Root Mean Squared Error (RMSE) and R-squared values to see how
accurate each model is.
This helps us to understand which method works best for predicting vehicle prices accurately
Develop machine learning model
Why metrics like Root Mean Squared Error (RMSE) and R-squared values to see how accurate each model is?
Develop machine learning model
RMSE Limitations
RMSE is sensitive to outliers since errors are squared.
A single large error can disproportionately affect the RMSE.
Develop machine learning model
R-squared indicates how well the independent variables explain the variability of the
dependent variable, with values closer to 1 suggesting a better fit.
Develop machine learning model
Develop machine learning model
Develop machine learning model
Develop machine learning model
Regression Analysis In ML
Regression analysis is a statistical technique that predicts continuous numeric values based on the
relationship between independent and dependent variables.
The main goal of regression analysis is to plot a line or curve that best fit the data and to estimate
how one variable affects another.
Regression analysis is a fundamental concept in machine learning and it is used in many
applications such as forecasting, predictive analytics, etc.
Regression models use the input data features (independent variables) and their corresponding
continuous numeric output values (dependent or outcome variables) to learn specific associations
between inputs and corresponding outputs.
Develop machine learning model
Linear Regression
Linear Regression is a supervised learning algorithm used for predicting a continuous target
variable based on one or more input variables (features).
It assumes a linear relationship between the dependent and independent variables and uses a linear
equation to model this relationship.
Develop machine learning model
Linear Regression
Linear regression is the most commonly used regression model in machine learning.
It may be defined as the statistical model that analyses the linear relationship between a dependent
variable with a given set of independent variables.
A linear relationship between variables means that when the value of one or more independent variables
changes (increase or decrease), the value of the dependent variable will also change accordingly (increase
or decrease).
Linear regression is further divided into two subcategories:
1. simple linear regression and
2. multiple linear regression (also known as multivariate linear regression).
Develop machine learning model
Quiz
1. What is the difference between random forest and regression?
2. Why is random forest better than regression?
Develop machine learning model