{"id":22445457,"url":"https://github.com/anas436/cars-price-prediction-using-python","last_synced_at":"2026-04-08T18:05:25.729Z","repository":{"id":110394407,"uuid":"512506737","full_name":"Anas436/Cars-Price-Prediction-Using-Python","owner":"Anas436","description":null,"archived":false,"fork":false,"pushed_at":"2022-07-10T19:11:12.000Z","size":181,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-22T09:53:54.823Z","etag":null,"topics":["ibm-watson","jupyter-notebook","linear-regression","matplotlib","multiple-linear-regression","numpy","pandas","pipline","polynomial-regression","python3","seaborn","sklearn","sklearn-metrics","standardscaler"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Anas436.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-10T18:14:21.000Z","updated_at":"2022-07-12T14:46:15.000Z","dependencies_parsed_at":"2023-04-23T13:18:07.061Z","dependency_job_id":null,"html_url":"https://github.com/Anas436/Cars-Price-Prediction-Using-Python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Anas436/Cars-Price-Prediction-Using-Python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anas436%2FCars-Price-Prediction-Using-Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anas436%2FCars-Price-Prediction-Using-Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anas436%2FCars-Price-Prediction-Using-Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anas436%2FCars-Price-Prediction-Using-Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Anas436","download_url":"https://codeload.github.com/Anas436/Cars-Price-Prediction-Using-Python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anas436%2FCars-Price-Prediction-Using-Python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28133008,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-30T02:00:05.476Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ibm-watson","jupyter-notebook","linear-regression","matplotlib","multiple-linear-regression","numpy","pandas","pipline","polynomial-regression","python3","seaborn","sklearn","sklearn-metrics","standardscaler"],"created_at":"2024-12-06T03:14:30.793Z","updated_at":"2025-12-30T22:06:58.891Z","avatar_url":"https://github.com/Anas436.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cars-Price-Prediction-Using-Python\n\n\n\n\u003ch3\u003eDecision Making: Determining a Good Model Fit\u003c/h3\u003e\n\n\u003cp\u003eNow that we have visualized the different models, and generated the R-squared and MSE values for the fits, how do we determine a good model fit?\n\u003cul\u003e\n    \u003cli\u003e\u003ci\u003eWhat is a good R-squared value?\u003c/i\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/p\u003e\n\n\u003cp\u003eWhen comparing models, \u003cb\u003ethe model with the higher R-squared value is a better fit\u003c/b\u003e for the data.\n\u003cul\u003e\n    \u003cli\u003e\u003ci\u003eWhat is a good MSE?\u003c/i\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/p\u003e\n\n\u003cp\u003eWhen comparing models, \u003cb\u003ethe model with the smallest MSE value is a better fit\u003c/b\u003e for the data.\u003c/p\u003e\n\n\u003ch4\u003eLet's take a look at the values for the different models.\u003c/h4\u003e\n\u003cp\u003eSimple Linear Regression: Using Highway-mpg as a Predictor Variable of Price.\n\u003cul\u003e\n    \u003cli\u003eR-squared: 0.49659118843391759\u003c/li\u003e\n    \u003cli\u003eMSE: 3.16 x10^7\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/p\u003e\n\n\u003cp\u003eMultiple Linear Regression: Using Horsepower, Curb-weight, Engine-size, and Highway-mpg as Predictor Variables of Price.\n\u003cul\u003e\n    \u003cli\u003eR-squared: 0.80896354913783497\u003c/li\u003e\n    \u003cli\u003eMSE: 1.2 x10^7\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/p\u003e\n\n\u003cp\u003ePolynomial Fit: Using Highway-mpg as a Predictor Variable of Price.\n\u003cul\u003e\n    \u003cli\u003eR-squared: 0.6741946663906514\u003c/li\u003e\n    \u003cli\u003eMSE: 2.05 x 10^7\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/p\u003e\n\n\u003ch3\u003eSimple Linear Regression Model (SLR) vs Multiple Linear Regression Model (MLR)\u003c/h3\u003e\n\n\u003cp\u003eUsually, the more variables you have, the better your model is at predicting, but this is not always true. Sometimes you may not have enough data, you may run into numerical problems, or many of the variables may not be useful and even act as noise. As a result, you should always check the MSE and R^2.\u003c/p\u003e\n\n\u003cp\u003eIn order to compare the results of the MLR vs SLR models, we look at a combination of both the R-squared and MSE to make the best conclusion about the fit of the model.\n\u003cul\u003e\n    \u003cli\u003e\u003cb\u003eMSE\u003c/b\u003e: The MSE of SLR is  3.16x10^7  while MLR has an MSE of 1.2 x10^7.  The MSE of MLR is much smaller.\u003c/li\u003e\n    \u003cli\u003e\u003cb\u003eR-squared\u003c/b\u003e: In this case, we can also see that there is a big difference between the R-squared of the SLR and the R-squared of the MLR. The R-squared for the SLR (~0.497) is very small compared to the R-squared for the MLR (~0.809).\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/p\u003e\n\nThis R-squared in combination with the MSE show that MLR seems like the better model fit in this case compared to SLR.\n\n\u003ch3\u003eSimple Linear Model (SLR) vs. Polynomial Fit\u003c/h3\u003e\n\n\u003cul\u003e\n    \u003cli\u003e\u003cb\u003eMSE\u003c/b\u003e: We can see that Polynomial Fit brought down the MSE, since this MSE is smaller than the one from the SLR.\u003c/li\u003e \n    \u003cli\u003e\u003cb\u003eR-squared\u003c/b\u003e: The R-squared for the Polynomial Fit is larger than the R-squared for the SLR, so the Polynomial Fit also brought up the R-squared quite a bit.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eSince the Polynomial Fit resulted in a lower MSE and a higher R-squared, we can conclude that this was a better fit model than the simple linear regression for predicting \"price\" with \"highway-mpg\" as a predictor variable.\u003c/p\u003e\n\n\u003ch3\u003eMultiple Linear Regression (MLR) vs. Polynomial Fit\u003c/h3\u003e\n\n\u003cul\u003e\n    \u003cli\u003e\u003cb\u003eMSE\u003c/b\u003e: The MSE for the MLR is smaller than the MSE for the Polynomial Fit.\u003c/li\u003e\n    \u003cli\u003e\u003cb\u003eR-squared\u003c/b\u003e: The R-squared for the MLR is also much larger than for the Polynomial Fit.\u003c/li\u003e\n\u003c/ul\u003e\n\n\n\u003ch2\u003eConclusion\u003c/h2\u003e\n\n\u003cp\u003eComparing these three models, we conclude that \u003cb\u003ethe MLR model is the best model\u003c/b\u003e to be able to predict price from our dataset. This result makes sense since we have 27 variables in total and we know that more than one of those variables are potential predictors of the final car price.\u003c/p\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanas436%2Fcars-price-prediction-using-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanas436%2Fcars-price-prediction-using-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanas436%2Fcars-price-prediction-using-python/lists"}