Giter Site home page Giter Site logo

felix-schott / traffic-accidents Goto Github PK

View Code? Open in Web Editor NEW

This project forked from felluksch/traffic-accidents

0.0 0.0 0.0 9.07 MB

Home Page: https://felixschott.net/traffic-accidents

License: GNU General Public License v3.0

JavaScript 18.48% Python 4.61% CSS 7.66% HTML 9.41% Jupyter Notebook 59.84%

traffic-accidents's Introduction

Overview

This is a simple Flask app with a HTML/JS/CSS + Leaflet.js frontend. The app displays the number of traffic accidents per district in Berlin in 2019 relative to area. Users can sample n % of districts and let a pretrained Regression-Kriging model predict the values for the missing districts based on daily traffic volume. The demo can be accessed here.

The folder backend contains all python scripts, including the notebooks cleaning1 and cleaning2 that contain all the data preparation work. Data sources are listed in the readme file in the data directory. train_model contains the actual model. app sets up the API and runs a local development server (the demo is deployed on a linux server using nginx/gunicorn/pm2).

frontend contains the app frontend. All geodata is dynamically requested from the backend (API specified in backend/app.py) and then rendered on the client side using Leaflet.js.

How to run the app on your machine

  1. Clone the repo.
  2. cd into the backend subdirectory.
  3. Create and activate a virtual environment.
  4. Run pip install -r requirements.txt to install the dependencies.
  5. Run the app with python app.py.

traffic-accidents's People

Contributors

felluksch avatar

traffic-accidents's Issues

Dockerise/microservices

Description

Containerise the servers, create docker-compose file with postgis db, proxy, frontend and backend server.

Restructure

Description

Restructure code into 4 domains:

  • data: contains data ingestion notebooks, push to postgis db
  • model: contains the model training notebook
  • server: contains the server module
  • frontend: stays as is, contains the frontend

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.