{"id":15131103,"url":"https://github.com/gfav-cybergeek/prodigy_ml_01","last_synced_at":"2025-04-05T20:29:50.812Z","repository":{"id":257654779,"uuid":"858699843","full_name":"Gfav-CyberGeek/PRODIGY_ML_01","owner":"Gfav-CyberGeek","description":"A linear regression model to predict house prices based on square footage, number of bedrooms, and bathrooms. Includes feature engineering, preprocessing, and model evaluation.","archived":false,"fork":false,"pushed_at":"2024-09-17T19:53:01.000Z","size":316,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-11T20:50:09.890Z","etag":null,"topics":["ai","airtificialintelligence","algorithms","algorithms-and-data-structures","data-structures","data-visualization","jupyter","jupyter-notebook","jupyterlab","machine-learning","machine-learning-algorithms","machine-learning-models","python"],"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/Gfav-CyberGeek.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":"2024-09-17T11:35:06.000Z","updated_at":"2024-09-17T19:53:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"7f9f8ba4-6763-4938-acd4-50c89cd8f73f","html_url":"https://github.com/Gfav-CyberGeek/PRODIGY_ML_01","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"ca82685d00d816c9396d636090f18b4d95de54e8"},"previous_names":["gfav-cybergeek/prodigy_ml_01"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gfav-CyberGeek%2FPRODIGY_ML_01","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gfav-CyberGeek%2FPRODIGY_ML_01/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gfav-CyberGeek%2FPRODIGY_ML_01/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gfav-CyberGeek%2FPRODIGY_ML_01/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Gfav-CyberGeek","download_url":"https://codeload.github.com/Gfav-CyberGeek/PRODIGY_ML_01/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247398416,"owners_count":20932734,"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","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":["ai","airtificialintelligence","algorithms","algorithms-and-data-structures","data-structures","data-visualization","jupyter","jupyter-notebook","jupyterlab","machine-learning","machine-learning-algorithms","machine-learning-models","python"],"created_at":"2024-09-26T03:23:20.850Z","updated_at":"2025-04-05T20:29:50.789Z","avatar_url":"https://github.com/Gfav-CyberGeek.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PRODIGY_ML_01\n\n# House Price Prediction using Linear Regression\n\nThis repository contains the implementation of a linear regression model to predict the prices of houses based on their square footage, number of bedrooms, and bathrooms. The dataset is sourced from the [Kaggle House Prices: Advanced Regression Techniques](https://www.kaggle.com/c/house-prices-advanced-regression-techniques/data) competition, and additional features are used to improve model performance.\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Dataset](#dataset)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Model Details](#model-details)\n- [Results](#results)\n- [Future Improvements](#future-improvements)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Overview\n\nThis project implements a linear regression model to predict house prices using features such as:\n\n- Square Footage (`1stFlrSF`)\n- Number of Bedrooms (`BedroomAbvGr`)\n- Number of Bathrooms (`FullBath`)\n\nWe extended the model by adding more features, including the neighborhood, house style, garage capacity, and living area, and applied data preprocessing techniques such as scaling and one-hot encoding to handle categorical variables.\n\n## Dataset\n\nThe dataset is sourced from the Kaggle competition [\"House Prices: Advanced Regression Techniques\"](https://www.kaggle.com/c/house-prices-advanced-regression-techniques/data).\n\n- **Features used**: \n  - `1stFlrSF` (First floor square footage)\n  - `GrLivArea` (Above-ground living area square footage)\n  - `BedroomAbvGr` (Number of bedrooms above ground)\n  - `FullBath` (Number of full bathrooms)\n  - `TotalBsmtSF` (Total basement square footage)\n  - `OverallQual` (Overall material and finish quality)\n  - Categorical features like `Neighborhood`, `HouseStyle`, etc.\n\n- **Target variable**: `SalePrice` (House price in dollars)\n\n## Installation\n\nTo get started with this project, clone the repository and install the necessary dependencies:\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/Gfav-CyberGeek/PRODIGY_ML_01.git\n   cd PRODIGY_ML_01\n   ```\n\n2. Install dependencies:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n## Usage\n\n1. Download the dataset from the Kaggle competition [here](https://www.kaggle.com/c/house-prices-advanced-regression-techniques/data), and place the `train.csv` file in the project directory.\n\n2. Run the Python script:\n   ```bash\n   python model.py\n   ```\n\n3. The script will output the model's performance, including metrics such as Mean Squared Error (MSE) and R-squared (R²). Additionally, a scatter plot of actual vs predicted house prices will be displayed.\n\n### Example Output\n\n```\nMean Squared Error: 123456789.0\nR-squared: 0.85\nCross-validated R-squared scores: [0.80, 0.84, 0.81, 0.83, 0.82]\nAverage cross-validated R-squared: 0.82\n```\n\n## Model Details\n\n- **Preprocessing**: The dataset contains both numeric and categorical features. We used `StandardScaler` to scale numeric features and `OneHotEncoder` for categorical features.\n  \n- **Pipeline**: A scikit-learn pipeline was created to handle preprocessing and model training in a single step.\n\n- **Model**: A simple linear regression model was trained on the selected features. We experimented with both basic and extended features to improve the model's performance.\n\n### Features Used\n\n- `1stFlrSF`: First floor square footage\n- `GrLivArea`: Above-ground living area square footage\n- `BedroomAbvGr`: Number of bedrooms above ground\n- `FullBath`: Number of full bathrooms\n- `TotalBsmtSF`: Total basement square footage\n- `OverallQual`: Overall material and finish quality (ordinal)\n- `Neighborhood`: Categorical, represents house neighborhood\n- `HouseStyle`: Categorical, represents house architectural style\n- `GarageCars`: Number of cars that can fit in the garage\n\n## Results\n\nThe linear regression model performs reasonably well, with an R-squared score of around 0.82 after cross-validation. The model is able to capture the relationship between house prices and key features such as square footage, number of bedrooms, and quality indicators.\n\nA scatter plot of actual vs predicted prices is generated to visualize the model's performance.\n\n## Future Improvements\n\n1. **Feature Engineering**: Further engineering of features such as creating interaction terms between key variables (e.g., `OverallQual` and `GrLivArea`).\n2. **Advanced Models**: Explore more advanced models such as Ridge, Lasso, or Decision Trees to improve accuracy.\n3. **Hyperparameter Tuning**: Use `GridSearchCV` or `RandomizedSearchCV` to fine-tune hyperparameters for better performance.\n4. **Handling Missing Data**: Explore more sophisticated imputation techniques or drop features with a significant amount of missing data.\n\n## Contributing\n\nContributions are welcome! Feel free to submit a pull request or open an issue if you have any suggestions or find any bugs.\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature-branch`)\n3. Commit your changes (`git commit -am 'Add new feature'`)\n4. Push to the branch (`git push origin feature-branch`)\n5. Open a pull request\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfav-cybergeek%2Fprodigy_ml_01","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgfav-cybergeek%2Fprodigy_ml_01","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfav-cybergeek%2Fprodigy_ml_01/lists"}