# Inferring Long-Term Demand of Newly Established Stations for Expansion Areas in Bike Sharing System
## 3 Methodology
### G-Clustering  
Since thousands of corresponding categories for **POI**s exist in certain regions, it is impractical to perform a one-to-one clustering for mapping a single category to a class. Therefore, we propose G-clustering to allocate categories into classes, where the characteristics of each category are similar to those of all the other categories in the same class. The G-clustering is inspired by the Gini coefficient [14], which is an index proposed by [PERSON] to judge the fairness of annual income distribution according to the Lorenz curve. In order to apply the concept of the Lorenz Curve in our work, we modify the definition of it, which is illustrated in Figure 4. The Gini coefficient is equal to the area ratio between A and (A + B), and it is also equal to 2A since the sum area of A and B is 0.5. We apply this index to evaluate the distribution for each category in several regions clustered by geographical locations in the given problem space, and thus categories with similar distribution into the same clusters. The pseudocode for the G-clustering algorithm is depicted in Algorithm 1. ```
Input:\(C\), POI, P; Output:\(C\)\(C\)\(D\);
1. Cluster POI into \(D_{1}\) clusters: \(C_{1},C_{2},C_{3}\ldots C_{D_{1}}\) by DBSCAN according to POI geographical locations;
2. Initialize \(H^{D}=0\);
3. for i = 1 : m do
4. for j = 1 : l do
5. if\(p_{j,i}==1\)then
6. \(h_{i,C_{i}}\)+ = 1;
7. endfor
8. Initialize \(C\)\(C\)\(D\)\(=\)\(\{C\)\(C\)\({}_{0}\), \(C\)\({}_{1}\),...\(C\)\({}_{l}\)};
9. for k = 1 : m do
10. Category_point = CVF (\(h_{k}\));
11. idx = [10\({}^{\circ}\) Category_point] - 2;
12. \(C\)\(C\)\({}_{idx}\) append category k;
13. endfor
14. function CVF (array \(A\))
15. \(A\_norm\) = normalized(\(A\));
16. category_value_point = \((1-\text{gini}(A\_norm))+\frac{\text{gini}(A\_norm)}{\text{log}_{10}(sim(A\_norm) )+1}\);
17. return category_value_point
```  
**Algorithm 1** G-Clustering Algorithm  
The proposed G-clustering is composed of three parts: initialization (line 1), construction for heat matrix (line 2 to 7), clustering for categories (line 8 to 13). First, **POI** is clustered into \(D_{1}\) clusters, where \(D_{1}\) is adjustable and set to 20 in our evaluation. Next, a  
Figure 4: Lorenz Curve. heat matrix \(\mathbf{H^{D}}=\left\{h_{i,j}\right\}\) is constructed with \(h_{i,j}\) representing the number of the \(i\)th category in the \(j\)th cluster according to \(\mathbf{P}\). Meanwhile, \(\mathbf{C_{d}}\) refers to the corresponding cluster result of the \(j\)th \(\mathbf{POI}\) in line 1. We divide each category into different groups according to its value point; the result \(\mathbf{CC^{D}}\) is returned once all categories are run through and assigned to a certain cluster. Each item in \(\mathbf{CC^{D}}\) indicates a set of the same level categories; meanwhile, we set \(l=6\) in the following evaluation. Line 14 to 17 is a function that calculates the category value point. In this function, the Gini coefficient is applied to measure the distribution of each category in different clusters. The more even the distribution is, the closer this index gets to 0 (closer to the blue line in Figure 4); otherwise, it gets closer to 1 (closer to the red line in Figure 4). The function in lines 14 to 17 is designed to determine whether a category is indicative or not. The more even the distribution, the higher the value point, and the less indicative the category is. On the other hand, we also apply K-means to reallocate \(\mathbf{POI}\) into \(D_{2}\) clusters as described in line 1, where \(D_{2}\) is set to 20 in our evaluation, and all other steps for G-clustering are left the same. The two types of clustering results are listed in Table 2.  
We list several representative categories in each cluster to explain the effectiveness of the G-Clustering algorithm. In the left column of Table 2 (DBSCAN), categories more evenly distributed in the area such as Fitness Venues and Retail Banks are clustered in the same class since these types of \(\mathbf{POI}\)s have no obvious regional characteristics.