analytics-ufcg/best-trip-recommender

Name: best-trip-recommender

Owner: Laboratório Analytics

Description: Bus Trip Recommendation API implemented in R, using bus location, ticketing and schedule data.

Created: 2016-11-01 14:46:02.0

Updated: 2016-11-03 12:47:32.0

Pushed: 2017-05-25 19:04:23.0

Homepage: null

Size: 13633

Language: R

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Recommendation Service Manager

The Recommendation Service Manager holds the procedure of paralleling multiple requests to the BestTripRecommender.

Its architecture is structured as shown below:

![](best_trip_recommender/Diagrams/recommendation service manager diagram.png)

The Application makes several requests to the Web Service. This one is responsable for distributing those requests into multiple processes, each one will execute in an individual gate of our Virtual Machine in a parallelized way. These processes receive the requests with the input data and apply our prediction algorithms. Thereunto, the processes need to access our database that contains historical data about buses trips. This data is processed and the output is sent to the application.

The detailed procedure that occurs in each of those processes is described right below.

BestTripRecommender

The Best Trip Recommender is a service that allows you to create a prediction system for the public transportation services of your city. So far the system can predict the duration of a trip and its number of passengers.

The recommender architecture is structured as shown below:

After the feature extraction in the Feature Factory module the data already contains the feature necessary to predict the number of passengers and the trip duration.

How to use

Starting API
on run_api.py <num_processes> <method: lasso|svm> <best_trip_recommender_folderpath> <training_data_filepath> <test_metadata_filepath> <model_data_filepath>

Where:

API Usage
lhost:<port>/train_model
ritiba examples
lhost:<port>/get_best_trips?route=022&time=10:00:00&date=2016-10-26&bus_stop_id=26276
lhost:<port>/get_best_trips?route=507&time=17:00:00&date=2017-02-04&bus_stop_id=26255

mpina Grande example
lhost:<port>/get_best_trips?route=0500&time=14:23:00&date=2016-09-01&bus_stop_id=97

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.