{"id":25391495,"url":"https://github.com/estnafinema0/housing-price-analysis","last_synced_at":"2026-05-13T23:36:52.043Z","repository":{"id":274711500,"uuid":"923824899","full_name":"estnafinema0/Housing-Price-Analysis","owner":"estnafinema0","description":"Predicting housing prices with regression models and visual analytics. Includes preprocessing, custom pipelines, and visualized performance metrics.","archived":false,"fork":false,"pushed_at":"2025-01-30T11:55:02.000Z","size":1847,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-28T09:43:56.133Z","etag":null,"topics":["custom-models","data-preprocessing","data-visualization","eda","exploratory-data-analysis","housing-prices","jupyter-notebook","machine-learning","pipelines","regression-models","seaborn","sklearn"],"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/estnafinema0.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":"2025-01-28T22:10:40.000Z","updated_at":"2025-02-02T22:18:48.000Z","dependencies_parsed_at":"2025-01-28T23:26:13.649Z","dependency_job_id":"8f79b3fc-3099-44df-8933-8d351f1e0863","html_url":"https://github.com/estnafinema0/Housing-Price-Analysis","commit_stats":null,"previous_names":["estnafinema0/housing-price-prediction","estnafinema0/housing-price-analysis"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/estnafinema0/Housing-Price-Analysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/estnafinema0%2FHousing-Price-Analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/estnafinema0%2FHousing-Price-Analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/estnafinema0%2FHousing-Price-Analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/estnafinema0%2FHousing-Price-Analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/estnafinema0","download_url":"https://codeload.github.com/estnafinema0/Housing-Price-Analysis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/estnafinema0%2FHousing-Price-Analysis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33004611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"ssl_error","status_checked_at":"2026-05-13T13:14:51.610Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["custom-models","data-preprocessing","data-visualization","eda","exploratory-data-analysis","housing-prices","jupyter-notebook","machine-learning","pipelines","regression-models","seaborn","sklearn"],"created_at":"2025-02-15T15:43:00.233Z","updated_at":"2026-05-13T23:36:52.017Z","avatar_url":"https://github.com/estnafinema0.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Housing Price Analysis\n\nA research project inspired by Yandex ML trainings. It's for predicting **house prices** in Ames with **exploratory analysis (EDA)** and **visual comparisons** of regression models.\n\nThe project includes:\n- **Preprocess continuous and categorical features**\n- **Custom regression models**\n- **Оne-hot encoding** for categorical variables\n- **Training pipelines**\n- **Visualize data and model performance** via metrics such as MAE, RMSLE, etc\n\n---\n\n## Table of Contents\n\n- [Housing Price Analysis](#housing-price-analysis)\n  - [Table of Contents](#table-of-contents)\n  - [Overview](#overview)\n  - [Data description](#data-description)\n  - [Installation](#installation)\n  - [Usage](#usage)\n    - [Where is the project?...](#where-is-the-project)\n    - [Scripts](#scripts)\n  - [Classes and Models](#classes-and-models)\n    - [Data Preprocessing](#data-preprocessing)\n    - [Custom Models](#custom-models)\n    - [Pipelines](#pipelines)\n  - [📊 Visualizations](#-visualizations)\n    - [Data Analysis](#data-analysis)\n    - [Feature Correlations](#feature-correlations)\n    - [Location Analysis](#location-analysis)\n    - [Model Performance](#model-performance)\n    - [Training Dynamics](#training-dynamics)\n    - [Prediction Accuracy](#prediction-accuracy)\n  - [Results](#results)\n---\n\n## Overview\n\nThis project builds a regression model to predict housing prices in [Ames, Iowa](https://www.openml.org/d/41211).  \nI use:\n\n- **Continuous data transformations**: scaling.\n- **Categorical data encoding** via `OneHotEncoder`.\n- **Custom linear regression** using stochastic gradient descent, with optional L2 regularization.\n- **Hyperparameter tuning**: grid search and cross-validation.\n- **Logarithmic transformations** of the target variable for improved model stability.\n\n---\n\n## Data description\n\nThe data is split into **training** and **testing** sets.\nThe **Ames Housing** key columns include:\n\n1. **Continuous features**: `Year_Built`.\n2. **Categorical features**: `Overall_Qual`.\n3. **Target variable**: `Sale_Price`.\n\n\n---\n\n## Installation\n\n1. **Clone the repository**:\n\n   ```bash\n   git clone https://github.com/estnafinema0/Housing-Price-Analysis.git\n   cd Housing-Price-Analysis\n   ```\n2. **Create a virtual environment**:\n\n   ```bash\n   python -m venv venv\n   source venv/bin/activate   \n   ```\n   Working on Linux.\n3. **Install requirements**:\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n---\n\n## Usage\n\n### Where is the project?...\n\nThe complete analysis is in `notebook.ipynb`.\nJust open and run cells in sequence! \n\n### Scripts\n\nIf you want to check particular parts of the project, look at the `scripts/` folder.\n\n## Classes and Models\n\n### Data Preprocessing\n\n1. **`BaseDataPreprocessor`**  \n   - Picks out number-based columns you want to use\n   - Makes all numbers work on the same scale\n\n2. **`SmartDataPreprocessor`**  \n   - Adds helpful new data like distance to city center\n   - Fixes missing data by using middle values\n   - Makes numbers ready for the model to use\n   - Makes predictions better by using real-world knowledge\n\n3. **`OneHotPreprocessor`**  \n   - Built on top of `BaseDataPreprocessor`\n   - Turns text data (like house zones and sale types) into numbers the model can use\n\n### Custom Models\n\n1. **`ExponentialLinearRegression`**  \n   - A special version of the `Ridge` model\n   - Changes house prices to a better format while learning\n   - Changes them back when making predictions\n\n2. **`SGDLinearRegressor`**  \n   - A model that learns step by step\n   - Keeps track of how well it's learning\n   - Shows you how it improves over time\n\n### Pipelines\n\nWe have several ready-to-use pipelines to make predictions:\n\n1. **`make_base_pipeline()`**\n   - The simple version that works with just numbers\n   - Uses `BaseDataPreprocessor` and basic `Ridge` model\n\n2. **`make_onehot_pipeline()`**\n   - Our best performer!\n   - Handles both numbers and categories (like house zones)\n   - Uses `OneHotPreprocessor` to turn text into numbers\n\n3. **`make_smart_pipeline()`**\n   - Uses `SmartDataPreprocessor` to add helpful new data\n   - Good for when you want to use location data\n\nEach pipeline combines data preparation and model training into one easy step. Just use `fit()` and `predict()`! 😊\n\n---\n\n## 📊 Visualizations\n\nStep-by-step visualizations.\n\n### Data Analysis\n\n![Price Distribution](/visualizations/Distribution%20of%20Sale%20Price.png)\nThe distribution of house prices shows a clear right-skew pattern. We found that log-transformation makes the data more normally distributed, which helps our models perform better.\n\n### Feature Correlations\n\n![Feature Correlations](/visualizations/Feature%20Correlations.png)\n\nFor 'Sale_Price' could be important location-based features (Longitude, Latitude). Also they show weak correlations with other features.\n\n### Location Analysis\n\n![Price vs. Distance to Center](/visualizations/Price%20vs.%20Distance%20to%20Center.png)\n![Property Locations Colored by Price](/visualizations/Property%20Locations%20Colored%20by%20Price.png)\nWe see interesting neighborhood patterns:\n- Higher-priced clusters in northern areas\n- Price variations more tied to neighborhood than distance to center\n\n### Model Performance\n\n![Model Comparison](/visualizations/Model%20Comparison.png)\nOur model comparison shows:\n- OneHot Pipeline leading with lowest MAE (~18,000)\n- Clear performance ranking: OneHot \u003e Exponential \u003e Base \u003e SGD\n\n### Training Dynamics\n\n![SGD Training](visualizations/SGD%20Dynamics.png)\nThe SGD Regressor's training shows:\n- Loss stabilization around 800 iterations\n- After 800 iterations, the model's performance starts to decrease, because of the overfitting.\n\n### Prediction Accuracy\n\n![Predictions vs Actual](visualizations/Scatter%20plots:%20predicted%20vs.%20actual.png)\nThe scatter plots show that the OneHot Pipeline follows the ideal prediction line most closely.\n\n\u003e 💡 Check out `notebook.ipynb` to recreate these visualizations.\n---\n\n## Results\n\n| Model                    | MAE    | RMSLE  | Notes                                          |\n|-------------------------|--------|---------|------------------------------------------------|\n| **OneHot Pipeline**     | 18,000 | 0.155  | Best performer! Great with categorical features |\n| **Base Pipeline**       | 23,000 | 0.190  | Simple but stable baseline                     |\n| **Exponential Pipeline**| 20,500 | 0.182  | Good with price distribution                   |\n| **SGD Regressor**       | 26,000 | 0.200  | Shows instability after 800 iterations         |\n\n\u003e 💡 **Key results:**\n\u003e - OneHot Pipeline shows best results across both metrics\n\u003e - SGD Regressor needs more tuning to compete with other models\n---\n\nThanks for checking out, guys! ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Festnafinema0%2Fhousing-price-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Festnafinema0%2Fhousing-price-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Festnafinema0%2Fhousing-price-analysis/lists"}