# Learning from Imbalanced Datasets: The Bike-Sharing Inventory Problem Using Sparse Information +
## 4 Numerical Results  
### Case Study  
The methods discussed in the previous section are now tested adopting real data from the Citi Bike station-based service in New York City, US (about 900 stations and 14,500 shared bikes available). In particular, the database for the machine learning derives from over 17 million rides during 2018.  
The trained models estimate the LB/UB of bikes adopting the available features reported in Table 1. Given the capacity at the station and the LB/UB of bikes, the number of docks is then calculated as in Equations (3) and (4). A correlation analysis of the features is performed to avoid redundant variables. All the ML algorithms, unless differently indicated, adopt 90% of the data as the training set and 10% for testing (randomly selected). Also, the benchmark values have been computed on the same 10% dataset, thus allowing for the comparison of the results.  
In the next subsections, we first analyze the data adopted in this research; the aim is twofold: (i) to underline if imbalance exists and (ii) if different features can impact the model explanation as a function of the considered class of the dependent variable. Then, the results are reported and, specifically, the following:  
* The computation of the UB and LB of the inventory problem by using different decision trees, i.e., RFC and GTBC, with and without combining them with a standard resam  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Feature Type** & **Characterization** & **[Unit]** \\ \hline \multirow{8}{*}{Exogenous} & Month & \\  & Weekday & \\  & Season & \\  & Capacity of the station & [number of bikes] \\  & Nearby stations & [number] \\  & Station location (inside/outside Manhattan) & [binary] \\ \hline \multirow{8}{*}{Endogenous} & Average number of departures/arrivals & \\  & observed in the previous two months, in the & [number] \\  & same referenced period & \\  & Number of departures/arrivals at the station & [number] \\  & in the previous day & [seconds] \\  & Departure/arrival trip duration observed at & \\  & the station the previous two months & \\  & Average LB (or UB) observed in the previous & \\  & two months, in the same referenced period & [number of bikes] \\  & and at the same station & \\ \hline \multirow{8}{*}{Behavioral \({}^{\star}\)} & Average temperature (current day) & [Classes from 1(Low) to 10 (High)] \\  & Average temperature (day before) & [Classes from 1(Low) to 10 (High)] \\  & Variability of the temperature (current day), & \\  & as the difference between the maximum and & [Classes from 1(Low) to 5 (High)] \\  & minimum registered & \\  & the difference between the maximum and & [Classes from 1(Low) to 5 (High)] \\  & minimum registered & \\  & Precipitation (current day) & [Classes 0 (Null) and from 1(Low) to 5 (High)] \\  & Precipitation (day before) & [Classes 0 (Null) and from 1(Low) to 5 (High)] \\  & Snow depth (current day) & [Classes 0 (Null) and from 1(Low) to 5 (High)] \\  & Snow depth (day before) & [Classes 0 (Null) and from 1(Low) to 5 (High)] \\ \hline Dependent variable & Bikes LB (or UB) & [number of bikes] \\ \hline \hline \end{tabular}  
* Weather data are assumed to approximate behavior, e.g., more rides when the temperature is high, less rides when the temperature is low.  
\end{table}
Table 1: Available features aggregated as a function of the feature type (adapted from [10]).  
pling technique (BorderlineSMOTE [34]) or with the iterative resampling approach discussed in Section 2;
* The prediction for new stations by adopting the best classifier as a result of the first point, again combining it with a standard resampling technique (BorderlineSMOTE) or with the iterative resampling approach;
* The first results in terms of predictions in a day-to-day framework as a result of applying Equation (9).  
The results are reported only in terms of bikes since docks can be calculated as the difference between the capacity at the station and the number of bikes.