# A Data-Driven Deep Learning Framework for Prediction of Traffic Crashes at Road Intersections
## 3 Preliminaries
### Data Description and Analysis
** The taxi trip data are collected and made available by the New York City Taxi and Limousine Commission (TLC) ([[https://data.cityofnewyork.us/Transportation/2016-Yellow-Taxi-Trip-Data/uacg-pexx/about_data](https://data.cityofnewyork.us/Transportation/2016-Yellow-Taxi-Trip-Data/uacg-pexx/about_data)]([https://data.cityofnewyork.us/Transportation/2016-Yellow-Taxi-Trip-Data/uacg-pexx/about_data](https://data.cityofnewyork.us/Transportation/2016-Yellow-Taxi-Trip-Data/uacg-pexx/about_data)), accessed on 15 December 2023). We obtain New York City's yellow taxis and green taxis records from 1 January 2014 to 30 June 2016 (the pick-up and drop-off locations of taxi trips are not available in the second half of 2016; we only consider the trip records in the first half of 2016). Each taxi trip record includes pick-up and drop-off dates or times, pick-up and drop-off locations (i.e., coordinates), trip distances, rate types, payment types, etc. Note that the taxi trips do not include their trip trajectories, i.e., they do not contain intermediate GPS points. In order to extract traffic flow at intersections, we propose a shortest-path-based method according to the taxi trip records. More specifically, we first map the pick-up and drop-off locations into the NYC road network, then apply the _Dijkstra_ algorithm to generate shortest paths based on the pick-up and drop-off locations. In a time interval \(\Delta t\), we treat each shortest path as one traffic flow at a specific intersection, then we define the summation of traffic flow in the time interval \(\Delta t\) as estimated traffic flow \(Flow_{v_{i}}(\Delta t)\). While we do not have the intermediate GPS points for those trips, the average travel time and trip distance of these historical trips provide us with a reasonable estimation of traffic speed from pick-up and drop-off locations at intersections. We calculate the average speed of all the historical taxi trips in time intervals \(\Delta t\) as the average speed of vehicles \(Speed_{v_{i}}(\Delta t)\). **Weather Data. ** Weather conditions (e.g., fog, rain, snow, dust, and so on) are one of the main factors affecting road traffic safety, which may cause slippery road conditions and reduce visibility, greatly increasing the risk of car accidents. Thus, we crawl hourly weather conditions between 1 January 2014 to 30 June 2016 from wunderground ([[https://www.wunderground.com/](https://www.wunderground.com/)]([https://www.wunderground.com/](https://www.wunderground.com/)), accessed on 11 January 2025). Figure 3 shows the distribution of the top nine types of weather conditions in traffic crashes that occurred at road intersections. We observe that unfair weather conditions are present at the time of traffic crashes in nearly 79-83% of cases weather conditions. Among the unfair conditions, clouds seem to be an important factor. As weather may change throughout the day, we consider the impact of weather changes at the time of car accidents, denoted as \(W_{v_{i}}(\Delta t)\) at intersection \(v_{i}\). In addition to weather conditions, we also consider other types of weather features, including dew point, humidity, pressure, wind speed, wind direction and visibility. Among these features, weather conditions, wind direction and visibility are categorical features, while the others are numerical features. Some statistics of the datasets are shown in Table 1.