Welcome to the Sreality anomaly detector - ML based tool that is supposed to search for the flats that are underpriced with comparison to the similar ones.
-
With usage of the Sreality's API, information of all currently available flats are requested, processed to table format and saved. In the current version, only '2+1' and '2+kk' flats are retrieved.
-
Extracted data are afterwards used for training of ML model, where price of the flats is used as the target variable. Light GBM is selected as the used ML algorithms for various reasons:
- Still provides state of the art performance for tabular data for both tasks - Classification and Regression
- Is tree based method - can easily discover interaction between independent features.
- Is nonlinear method - does not require linear relationship between target and feature, therefore does not require much of data preprocessing
- Can handle categorical variables implicitly (no one hot encoding or other method is necessary)
- Still relatively easily explainable with for Example Shap method (so far not implemented).
Cross validation is used for obtaining of optimal number of trees and therefore model would not be nor underfitting or overfitting. With this optimal number of trees, final model with all data is fit. Note: Script, that was used for feature selection is not enclosed. Feature performance of the model and its R2 performance is logged.
-
When model is fitted, API's endpoint over the prediction function of the model is run.
-
For all the flats that were scrapped in the first point, API request for prediction of the price is made. Afterwards difference between predicted price and actual price is calculated.
-
Email with top 15 underpriced (where difference between predicted and actual price is the biggest) flats is sent to my email address.
- Make folder, where data will be stored:
mkdir data
- Make folder, where model will be stored:
mkdir models
- Make folder, where whole repository will be stored:
mkdir sreality_anomaly_detector
- switch to this folder
cd sreality_anomaly_detector
- clone this repository
git clone [email protected]:pacaklu/sreality_anomaly_detector.git
- Run anomaly detection
bash run_all.sh