{"id":19889601,"url":"https://github.com/shimazadeh/ft_linear_regression","last_synced_at":"2026-06-03T20:31:17.004Z","repository":{"id":180992320,"uuid":"663674244","full_name":"shimazadeh/Ft_linear_regression","owner":"shimazadeh","description":"Implementing a modular linear regression from scratch to predict the price of cars using a gradient descent algorithm.","archived":false,"fork":false,"pushed_at":"2023-12-26T19:18:37.000Z","size":238,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T04:44:23.572Z","etag":null,"topics":["data-analysis","data-science","hyperparameter-tuning","linear-regression","predictive-modeling"],"latest_commit_sha":null,"homepage":"","language":"Python","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/shimazadeh.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":"2023-07-07T21:06:54.000Z","updated_at":"2023-12-04T19:14:04.000Z","dependencies_parsed_at":"2023-11-14T19:30:54.973Z","dependency_job_id":"b4da881f-32e7-42e8-906d-762957b51f75","html_url":"https://github.com/shimazadeh/Ft_linear_regression","commit_stats":null,"previous_names":["shimazadeh/ft_linear_regression"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shimazadeh/Ft_linear_regression","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shimazadeh%2FFt_linear_regression","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shimazadeh%2FFt_linear_regression/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shimazadeh%2FFt_linear_regression/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shimazadeh%2FFt_linear_regression/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shimazadeh","download_url":"https://codeload.github.com/shimazadeh/Ft_linear_regression/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shimazadeh%2FFt_linear_regression/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33878990,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"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":["data-analysis","data-science","hyperparameter-tuning","linear-regression","predictive-modeling"],"created_at":"2024-11-12T18:10:53.277Z","updated_at":"2026-06-03T20:31:16.988Z","avatar_url":"https://github.com/shimazadeh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DataScience | Linear regression from Scratch | 42Paris\n## Objective\nTo create a modular linear regression model from scratch, train the model on the given dataset, save generated indexes and use them to predict car price depending on it's mileage.\n\n## Requirements\nBefore running the program, make sure you have the following dependencies installed:\n  - numpy: A library for numerical computations.\n  - pandas: A library for data manipulation and analysis.\n  - matplotlib: A library for data visualization.\n  - scikit-learn: A machine learning library for data preprocessing and evaluation.\nYou can install these packages using pip if you don't have them already: pip install numpy pandas matplotlib scikit-learn\n\n## Usage\n- git clone https://github.com/shimazadeh/Ft_linear_regression.git Linear-regression\n- cd Linear-regression\n- python3 main.py [path/to/dataset.csv] [#iteration] [learning_rate] [mode]\n- There are two modes to the program:\n  - mode 1: finds the best thetas to be initialized using hyperparameter tuning technique\n  - mode 2: uses the parameters from best_params.json file created in the previous option and train and test the model based on that.\n\n## Approach\n- Data Preprocessing: The program reads the dataset from the CSV file, normalizes the data to the range of 0-1.\n- Train-Test Splitting: The program splits the dataset into training and test sets.\n- Hyperparameter Tuning: It uses hyperparameter tuning method to find the best initial parameters (thetas) for the linear regression model.\n- Model Training: The linear regression model is trained using gradient descent. The program visualize the training process and print the model parameters, Loss, MSE and MAE each iteration:\n![Alt text](\u003cScreen Shot 2023-11-15 at 10.29.44 AM.png\u003e)\n\n- Model Evaluation: After training, the program predicts prices using the test set and calculates the Mean Squared Error (MSE) and Mean Absolute Error (MAE) to evaluate the model's performance.\n- Visualization: The program visualizes the normalized dataset, the regression model, and the cost function as shown below:\n  \n![Alt text](output.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshimazadeh%2Fft_linear_regression","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshimazadeh%2Fft_linear_regression","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshimazadeh%2Fft_linear_regression/lists"}