Skip to content

bapfeld/scoothome

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

393 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scoot Home – Be confident in your future bike and scooter options

Scoot Home is an app developed as part of the Insight Data Science Program. It predicts the future availability of shared micromobility vehicles (dockless bikes and scooters) around Austin, TX.

Under the Hood

  1. Data on approximately 8.5 million ride are collected from the City of Austin’s API
  2. Data is binned into approximately 375 geographic areas defined by population density and converted into time series
  3. Time series modeled using FB Prophet and used to produce predictions
  4. Predictions are loaded into remote postgres database and served to the user using a Flask app hosted on AWS

Algorithm Considerations

  • Prophet parameter tweaks
    • Custom holiday specification for Austin events SXSW and ACL fest because these events create massive disruptions to all transportation in the city.
    • Changepoint prior scale for overall model and holidays. I opt for a relaxed parameter to allow the model great flexibility in changing direction rapidly.
    • Additional covariaties. I experimented with using weather data in the model. Despite strong expectations that variables like temperature and precipitation would be important in capturing scooter and bike usage, these variables added very little predictive power and are not included in the final model
  • Systematic low estimates
    • The Prophet models tend to predict low in comparison to real data points. This is a desirable feature of the model: an overestimate could leave a user of the app unable to complete their journey as planned, increasing time and cost and defeating the purpose of the app.

Project Structure

├── data                            <- Shapefiles for geographic areas
│   ├── census_tracts
│   ├── council_districts
├── figures                         <- Output figures from models
│   ├── prophet_tuning
│   │   ├── avail
│   │   └── radical
│   ├── time_series_by_area.pdf
│   └── ts
├── README.org
├── requirements.txt                <- Project-wide requirements file for pip install
├── scoothomeflask                  <- Flask application
│   ├── __init__.py
│   ├── requirements.txt            <- Package requirements for flask app only
│   ├── scoothome.py                <- Definition of application functions and routes
│   ├── static                      <- Website static files
│   └── templates                   <- Website html templates
│       ├── 404.html
│       ├── details.html
│       ├── index.html
│       └── results.html
├── setup.ini                       <- Required ini file with various api keys (ignored in repo)
└── src                             <- Model files
    ├── arima.py
    ├── basic_vis.py
    ├── clean_mobility_data.py
    ├── combine_multi_ts_output.py  <- Combines individual area records
    ├── convert_time_series.sh
    ├── convert_to_ts.py            <- Converts tabular vehicle records to time series
    ├── create_db.sql               <- Creates the postgres database
    ├── demo_vis.py
    ├── estimate_bike_models.sh
    ├── estimate_models.py          <- Wrapper code for processing models for all areas
    ├── estimate_models.sh
    ├── estimate_usage.py
    ├── fetch_predictions.py
    ├── get_past_weather.py
    ├── get_past_weather.sh
    ├── import_scoot_data.py
    ├── make_holidays.py
    ├── maps.py
    ├── model.py                    <- Define the model object
    ├── model_selection.py
    ├── model_selection.sh
    ├── prophet.py
    ├── pyaf.py
    ├── run_update.sh
    ├── test_for_update.py
    ├── test_for_update.sh
    ├── test_in_use.py
    ├── time_vis.py
    ├── update.py                   <- Wrapper code for updating data and models
    ├── update.sh                   <- Script to execute updater
    └── weather_features.py

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors