Coder Social home page Coder Social logo

hamburg_rent_price_forecasting's Introduction

FORECASTER FOR PRICES IN HAMBURG

In this project you can find some things for forecasting prices.

  • Jupyter-notebook with some EDA, data processing, training some models;
  • Service with API for predict prices by features; forecaster
  • Example script with instruction for using that. example.py

Some assumptions:

In the dataset we have feature rent_base -- I think it's a leak feature :) But I am really not sure will be it in the test dataset -- in the notebook I try different models with this feature and without that.

I don't know quality of Seasonal Naive model -- and also I'm not sure that my solution better or not.

Also, I could not formulate this problem in terms of time series, so I solved it as a regression problem.

Data was sometimes noisy (flat_type with mistake, huge differences between some base and total_rent prices. And I think we have only one year -- also it's not enough for good validation.

And (imho) this this quality is quite low -- but I would like to know how to solve this problem with the best results.

Simple usage

Start service: docker-compose up --build

It will be started in http://0.0.0.0:2282

After that you can trigger API method /preidct and send to it test pandas Dataframe in to_dict() view. (see example.py for more details)

import requests


message_to_send = {'cnt_rooms': 1,
                   'flat_area': 37.0,
                   'rent_base': 462.0,
                   'flat_type': 'apartment',
                   'flat_interior_quality': 'average',
                   'flat_condition': 'good',
                   'flat_age': '60+',
                   'has_elevator': 'f',
                   'has_balcony': 'f',
                   'has_garden': 'f',
                   'has_kitchen': 't',
                   'has_guesttoilet': 'f',
                   'geo_city_part': 'wandsbek',
                   'date': '2018-02-2',
                   'flat_thermal_characteristic': 'None',
                   'geo_city': 'hamburg'}

resp = requests.post("http://localhost:2282/predict",
                     json=message_to_send)

print(resp.status_code)
print(resp.text)

Answer:

200
{"pred":{"0":566.0894462133544}}

Ideas and TODO:

I have some ideas how to make it better and what should by tried:

  • Target Encoding for categorial features
  • Quantile Transformation for prices
  • Try RNN models
  • Try to drop more outliers & use ordinal features too
  • Also should add tests to service
  • Refactor, change some structure, maybe add webUI
  • Add logging

hamburg_rent_price_forecasting's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.