Linear regression using Statsmodel vs Scikit Learn

Опубликовано: 16 Февраль 2026
на канале: Analytics Educator
292
4

An Indian automobile company, Kucchi Motors aspires to enter the US market for selling 2nd hand cars. They would like to understand which are the factors determine value of the used cars.
The value of a car drops right from the moment it is bought and the depreciation continues with each passing year. In fact, in the first year itself, the value of a car decreases by 20 percent of its initial value. The present price of a car, total kilometers driven, overall condition of the vehicle and various other factors further affect the car’s resale value
We will be using Python to build model using machine learning algorithm (start with Linear Regression) to predict the price of the used cars and the factors determining it's values. We will be using different pre processing of data to improve accuracy.

In the previous videos, we had shown how to improve accuracy by removing outliers and using random state. In this video, we will be using the statsmodel package of Python to run the linear regression. We will first show the accuracy derived from statsmodel, and then we will compare the results with scikit learn results.

We will be checking MAPE for understanding the accuracy. This will help us to improve the MAPE than what we had gotten in the previous step, where we hadn't done any outlier treatment.

You may visit our website : https://www.analyticseducator.com/ for more such articles and FREE courses.

You may read our blogs at https://www.analyticseducator.com/Blo...

You may ask us any questions you might have regarding data science and we will answer them free of cost. We will also publish your questions in your website along with the answers.
https://www.analyticseducator.com/Ask...

If you want to build a career in the field of data science then please contact us for our courses.
https://www.analyticseducator.com/ind...