Skip to content

🇵🇱🏠 The project predicts an apartment price for Warsaw, Krakow and Poznan. Distributed apartments by districts using geopandas; built XGBoost model with MAPE = 9% (the best of others).

Notifications You must be signed in to change notification settings

am-tropin/poland-apartment-prices

Repository files navigation

Price Predicting for Apartments in Poland

Predicting the price of apartment by its features (square, floor, district, distance from the center of the city, number of rooms, year of construction).

Libraries: numpy, pandas, opendatasets, geopandas, geopy, sklearn, xgboost, mlxtend, seaborn, matplolib, time, itertools, mlflow, fastapi

codecov Code Climate

Table of contents

Datasets

Machine learning problem

  • The given problem was solved by using XGBoost Regressor. It shows the lowest MAPE (Mean absolute percentage error) = 9% in comparison with other models: Linear Regression, Ridge, Lasso, Bagging Regressor (by 26-28%), Decision Tree (17%), k-Nearest Neighbors, Random Forest, Stacked Ensembles (by 14%), Gradient Boosting (13%), AdaBoost for XGBoost (9%). Besides, the predictor of price by custom data (using XGBoost model) was built. The result is in the model_evaluation.ipynb file.

The same code for both data processing and model evaluation also contains in the Poland_apartments__full.ipynb file.

Run locally

  1. Clone the project:
  git clone https://github.com/am-tropin/poland-apartment-prices
  1. Go to the project directory:
  cd poland-apartment-prices/app
  1. Start the server:
  uvicorn app.main:app --reload
  1. Go to web-browser
  http://127.0.0.1:8000/docs/

and use the following box: Get Main Predicting. Type city and district names, distance from the center of the city, floor number and number of rooms, apartment square and year of construction.

Or

  1. Go to web-browser and use the following link to get the same info after typing the parameters:
  http://127.0.0.1:8000/price/_

Or

  1. Go to web-browser and use the following type of links to get the same info in clear dictionary view:
  http://127.0.0.1:8000/main_predicting/Warszawa_Śródmieście_2_3_2_40_2000

MLflow Tracking

  1. Start the MLflow UI:
  mlflow ui
  1. Go to web-browser
  http://127.0.0.1:5000/

and choose poland_apartments experiment for comparing the models.

Docker

  1. Clone the project:
  git clone https://github.com/am-tropin/poland-apartment-prices
  1. Go to the project directory:
  cd poland-apartment-prices/app
  1. Create a docker container:
  docker build -t price-predictor .

About

🇵🇱🏠 The project predicts an apartment price for Warsaw, Krakow and Poznan. Distributed apartments by districts using geopandas; built XGBoost model with MAPE = 9% (the best of others).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages