# Fine-Scale Population Estimation Based on Building Classifications: A Case Study in Wuhan
## 2 Materials and Methods
### Classification of Urban Buildings
#### 2.2.2 Classification of Buildings with the _Tf-_idf_ Method  
In the _POI_ data, the number of commercial _POIs_ is much more than that of residential _POIs_. However, in the real world, the population is mainly distributed in residential buildings. This brings about a problem, residential buildings which are very important for classification, account for less in _POI_. _TF-IDF_ is a commonly used weighting technique for \begin{table}
\begin{tabular}{c c} \hline \hline
**Classification** & **Reclassification** \\ \hline automobile service, automobile sales, automobile maintenance, motorcycle service, catering service, shopping service, life service, sports and leisure service, accommodation service, corporate enterprise, financial and insurance service, business residence: industrial park, business residence: building, business residence: business residence related & commercial service \\ \hline medical and health care services, scenic spots, government institutions and social organizations, scientific, educational and cultural services, transportation facilities, road ancillary facilities, public facilities & public service \\ \hline business residence: residential area, place name and address information: door number information & residential building \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Reclassification of _POI_. Figure 3: Spatial distribution of buildings and _POIs_. information retrieval and data mining, where samples with a low frequency are of high importance in the local area. This is applicable to the uneven distribution of _POI_ data. For buildings with _POIs_ inside, the building type is judged according to the internal _POI_ type. Buildings without _POIs_ inside are classified using the _TF-IDF_ method. The steps in the building classification based on _TF-IDF_ are as follows. Step 1. Obtain the geometric center coordinates of a building. Formula (1) is used to calculate the geometric center coordinates of the building to represent the location of building \(i\) (\(i\) = 1, 2,..., \(m\); \(m\) is the total number of buildings), where \(x_{ij}\) and \(y_{ij}\) are the vertical and horizontal coordinates of the vertices of building \(i\) (\(j\) = 1, 2,..., \(n\); \(n\) is the total number of building vertices), respectively. \[\vec{x}_{i}=\frac{\sum_{1}^{n}x_{ij}}{n},\vec{y}_{i}=\frac{\sum_{1}^{n}y_{ij} }{n} \tag{1}\]  
Step 2. Calculate the _IDF_ values for different classes of \(k\). Formula (2) is used to calculate the IDF value (\(k\) = 1, 2,..., \(p\); \(p\) is the total number of _POI_ classes) for each _POI_ class \(k\), where \(GlobalPOI_{cluster_{k}}\) is the total number of \(k\) class _POIs_ in the subdistrict and \(1D_{cluster_{k}}\) is the _IDF_ value. \[IDF_{cluster_{k}}=\ln\left(\frac{\sum_{1}^{p}GlobalPOI_{cluster_{k}}}{Global POI_{cluster_{k}}}\right) \tag{2}\]  
Step 3. Calculate the _TF_ value for building \(i\). By taking the geometric centroid of building \(i\) as the center, the number of different _POI_ types in a certain range is counted and the _TF_ value is calculated using Formula (3), where \(LocalPOI_{cluster_{k}}\) represents the number of class \(K\)_POIs_ within a certain area of building \(i\). \[TF_{cluster_{k}}=\frac{LocalPOI_{cluster_{k}}}{\sum_{1}^{p}LocalPOI_{cluster _{k}}} \tag{3}\]  
Step 4. Calculate the _TF-IDF_ value. Formula (4) is used to calculate the _TF-IDF_ value of building \(i\) for different class \(k\)_POIs_ and the largest class is the building class. \[TFIDF_{cluster_{k}}=TF_{cluster_{k}}\times IDF_{cluster_{k}} \tag{4}\]  
Analyzing the significance and advantages of building classifications with the _TF-IDF_ method is useful for population estimation. By calculating the frequency of different _POI_ types around the center of buildings, we can get the _TF-IDF_ value of building categories. This method can efficiently and scientifically obtain classification data for buildings. It requires less time compared with manually assigning building categories.