Challenge
The response time is one of the most important factors for emergency services because their ability to save lives and rescue people depends on it.
A non-optimal choice of an emergency vehicle for a rescue request may lengthen the arrival time of the rescuers and impact the future of the victim. This choice is therefore highly critical for emergency services and directly relies on their ability to predict precisely the arrival time of the different units available.
NB: Any use of the image or name of the Paris Fire Brigade is subject to authorization from the Paris Fire Brigade.
A non-optimal choice of an emergency vehicle for a rescue request may lengthen the arrival time of the rescuers and impact the future of the victim. This choice is therefore highly critical for emergency services and directly relies on their ability to predict precisely the arrival time of the different units available.
NB: Any use of the image or name of the Paris Fire Brigade is subject to authorization from the Paris Fire Brigade.
- Challenge opening date: 8 July 2019
- Challenge closing date: 31 December 2020
- Challenge
- Dataset description
- External data sources potentially relevant
- Starting script
Challenge
This challenge is hosted by the Ecole Normale Supérieure (ENS) data platform.- the selection of a rescue vehicle (the time when a rescue team is warned)
- and the rescue team arrival time at the scene of the request (information sent manually via portable radio)
- the activation period of the rescue team
- the transit time of the rescue team
A first solution from a challenger has been published on GitHub: https://github.com/ds4es/unit-response-oracle
It was not possible for us to wait any longer for the publication of this fabulous work.
We will as soon as possible enhance it with the contributions of other challengers who also agreed to share their work with us. Thanks to all of them very much for the work carried out and shared.
What is extraordinary with this type of challenge is that the multitude of minds leads to the design of a multitude of methods which when combined lead us to an amazing solution that would have not been possible to reach with the involvement of only one mind.
Resources to consult for this challenge
- Using Data Science to Predict Response Times of Firefighters
- How Uber Engineers an Efficient Route
- Kaggle Challenge: New York City Taxi Trip Duration
Dataset description
Terms and conditions of data usage:- The data of the Paris Fire Brigade are the property of the Paris Fire Brigade and can not be transferred to others without the explicit agreement of the Paris Fire Brigade.
- The data provided as part of the challenge is intended for use only in this context. Any other use without the explicit agreement of the Paris Fire Brigade is forbidden.
The dataset covers the entire year 2018 for which inoperable data have been squeezed out.
Training data (219337 lines):
- x_train.csv
- y_train.csv
Test data (108033 lines):
Following the request of one of the challengers and facilitate the exploitation of GPS tracks for 30% of the dataset filled with this information, 2 "supplementary files" have been made available under the "Files" section of the ENS data challenge page.
Input parameters (x_train.csv and x_test.csv):
- [ID]
emergency vehicle selection
: identifier of the selection instance of an emergency vehicle for an intervention - Intervention
intervention
: identifier of the intervention- Alert reason
alert reason category
(category): alert reason categoryalert reason
(category): alert reason
- Address
intervention on public roads
(boolean): 1 when it concerns an intervention on public roads, 0 otherwisefloor
(int): floor of the interventionlocation of the event
(category): qualifies the location of the emergency request, for example: entrance hall, boiler room, motorway, etc.longitude intervention
(float): approximate longitude of the intervention addresslatitude intervention
(float): approximate latitude of the intervention address
- Emergency vehicle
emergency vehicle
: identifier of the emergency vehicleemergency vehicle type
(category): type of the emergency vehiclerescue center
(category): identifier of the rescue center to which belong the vehicle (parking spot of the emergency vehicle)
selection time
(datetime): selection time of the emergency vehicledate key selection
(int): selection date in YYYYMMDD formattime key selection
(int): selection time in HHMMSS format
- State of the emergency vehicle preceding its selection for an intervention
- Operational status of the vehicle preceding its selection
status preceding selection
(category): status of the emergency vehicle prior to selection. An emergency vehicle is in various statuses during an intervention:- Selection - selection of the emergency vehicle by the rescue commitment application
- Departed - the vehicle starts its route to the location of the emergency request
- Presented - the vehicle arrives at the location of the request
- Hospital transportation - the vehicle starts its transport of a victim to hospital
- Hospital arrival - the vehicle arrives at the hospital
- Leaving hospital - the vehicle leaves the hospital
- Returned - the vehicle has returned to its parking spot
- Leave the premises - because the vehicle can also simply leave the scene of an intervention without having to transport any victim
- Not available - for various reasons the vehicle can be in an unavailable position
- Not relevant - statutes without interest
delta status preceding selection-selection
(int): number of seconds before the vehicle was selected when its previous status was entered
- Operational status of the vehicle preceding its selection
departed from its rescue center
(boolean) : 1 when the vehicle departed from its rescue center (emergency vehicle parking spot), 0 otherwise- GPS position of the vehicle before departure
longitude before departure
(float): longitude of the position of the vehicle preceding his departurelatitude previous departure
(float): latitude of the position of the vehicle preceding his departuredelta position gps previous departure-departure
(int): number of seconds before the selection of the vehicle where its GPS position was recorded (when not parked at its emergency center)
- GPS tracks
GPS tracks departure-presentation
(float pair list): successive GPS positions (*longitude,latitude;longitude,latitude,* etc.) of the vehicle between departure and presentation. This information is for informational purposes to study vehicle behaviors. (The beacons, emitting the GPS positions of vehicles, are currently not always lit)GPS tracks departure-presentation datetime
(datetime list): datetime associated with successive GPS positions between the departure and the presentation of the vehicle.
- Estimated route
OSRM estimated route
(json object): service route response of an OSRM instance (http://project-osrm.org/docs/v5.15.2/api/#route-service) setup with the Ile-de-France OpenStreetMap dataOSRM estimated distance
(float): distance calculated by the OSRM route serviceOSRM estimated duration
(float): transit delay calculated by the OSRM route service
- [ID]
emergency vehicle selection
: identifier of a selection instance of an emergency vehicle for an intervention - [TO PREDICT]
delta selection-departure
(int): elapsed time in seconds between the selection and the departure of the emergency vehicle - [TO PREDICT]
delta departure-presentation
(int): elapsed time in seconds between the departure of the emergency vehicle and its presentation on the intervention scene - [TO PREDICT]
delta selection-presentation
(int): elapsed time in seconds between the selection of the emergency vehicle and its presentation on the intervention scene (delta selection-departure + delta departure-presentation)
- [ID]
emergency vehicle selection
: identifier of a selection instance of an emergency vehicle for an intervention -
OSRM estimate from last observed GPS position
(json object): service route response from last observed GPS position of an OSRM instance (http://project-osrm.org/docs/v5.15.2/api/#route-service) setup with the Ile-de-France OpenStreetMap data -
OSRM estimated distance from last observed GPS position
(float): distance (in meters) calculated by the OSRM route service from last observed GPS position -
OSRM estimated duration from last observed GPS position
(float): transit delay (in seconds) calculated by the OSRM route service from last observed GPS position -
time elapsed between selection and last observed GPS position
(float): in seconds -
updated OSRM estimated duration
(float): time elapsed (in seconds) between selection and last observed GPS position + OSRM estimated duration from last observed GPS position
External data sources potentially relevant
- Ile-de-France OpenStreetMap Data that could be used with a routing engine like OSRM
- Atmospheric parameters measured or observed
- Paris traffic data from permanent sensors under pavement
- Geographic repository for traffic data from permanent sensors
Starting script
The following script is aimed to be a starting point for the participants.import pandas as pd
import pandas as pd
import numpy as np
from sklearn.preprocessing import PolynomialFeatures
from sklearn.linear_model import LinearRegression
# Data reading
x_train = pd.read_csv('./data/x_train.csv', sep=',')
y_train = pd.read_csv('./data/y_train.csv', sep=',')
x_test = pd.read_csv('./data/x_test.csv', sep=',')
x_train_transit = x_train[['OSRM estimated distance','intervention on public roads','floor']]
y_train_transit = y_train[['delta departure-presentation']]
x_test_transit = x_test[['OSRM estimated distance','intervention on public roads','floor']]
# Create a predictive model for the 'delta departure-presentation'
# based on 'OSRM estimated distance', 'intervention on public roads' and 'floor'
polynomial_features= PolynomialFeatures(degree=3)
x_train_transit_poly = polynomial_features.fit_transform(x_train_transit)
model = LinearRegression()
model.fit(x_train_transit_poly, y_train_transit)
# Prediction of the 'delta selection-presentation'
x_test_transit_poly = polynomial_features.fit_transform(x_test_transit)
y_selection_presentation_predicted = y_train['delta selection-departure'].median() + model.predict(x_test_transit_poly)
# Create a submission file
submission = pd.concat([pd.DataFrame(x_test[['emergency vehicle selection']].values), \
pd.DataFrame(np.full((len(x_test), 1), y_train['delta selection-departure'].median())), \
pd.DataFrame(model.predict(x_test_transit_poly)), \
pd.DataFrame(y_selection_presentation_predicted)], \
axis=1)
submission.columns = list(y_train.columns.values)
submission.set_index('emergency vehicle selection', inplace=True)
submission.to_csv('./submission.csv', sep=",")
#### Evaluation function ####
# from sklearn.metrics import r2_score
#
# r2_score(observed_values,predited_values)
#############################