# Where We Rate: The Impact of Urban Characteristics on Digital Reviews and Ratings
## 3 Materials and Methods
### Data Integration, Feature Generation, and Prediction Model  
In this section, we present the process of integrating various datasets and generating features that describe the spatial, demographic and network-related characteristics relevant to consumer behavior in urban dining settings (Figure 2). The primary goal is to predict two dependent variables: review counts (categorized as high or low) and ratings (high score or low score), both divided into binary classes based on quantiles. We used a random forest classifier that predicted the high and low categories, a model that effectively manages diverse feature sets (FSs) using the interconnections between spatial, demographic and network properties.  
Figure 1: Melbourne City’s boundary (black polygon), case study area (red polygon), OSM streets (gray), sensor locations (purple points) and Google EDO POIs (yellow) overlaid on OSM base map.  
The features are organized into six sets, each representing a distinct aspect of the urban environment and potential consumer interaction.  
FS 1 (pedestrian count): This set consists of interpolated data for the annual (1) mean pedestrian counts per hour, (2) peak pedestrian count during the most crowded hour (17:00) in 2022 and 2023, and (3) number of residential dwellings in 2023. All values were processed with Inverse Distance Weighting (IDW), allowing a detailed spatial representation of pedestrian and resident density, which may impact both the review volume and ratings. Therefore, to integrate these values with POI data, we created Voronoi polygons based on the POIs, defining spatial catchments for each place (Figure 3). We then calculated the mean values of the pedestrian and residential dwelling data within each Voronoi cell, creating features that represent the localized movement and population density around each cell of places.  
FS 2 (distance to and shape of the street): This set includes (1) the Euclidean distance from each POI to its closest street and (2) the sinuosity of the closest street. These geometric  
Figure 3: Voronoi cells (polygons with black edges) using Google POIs (yellow points) as cell points.  
Figure 2: Workflow of the feature generation.  
measures describe the physical relationship between places and their surroundings, which may influence how consumers perceive and interact with these locations.  
FSs 3 and 4 (centrality measures): Both sets focus on centrality metrics, calculated with primal and dual approaches to model the impact of the street network structure on the prominence of the place. In both the primal (FS 3) and dual (FS4) approaches, we use eight metrics: betweenness (\(B\)), closeness (\(C\)), degree (\(D\)), eigenvector (\(E\)), harmonic (\(H\)), Katz centralities (\(K\)), load (\(L\)) and PageRank (\(P\)), all of which assess the connectivity within the network. These metrics help describe the extent of the integration or separation of each place within the urban grid.  
FS 5 (road functional class): This set is derived from OpenStreetMap _highway_ tags, which categorize streets based on their functional hierarchy, from motorway roads to minor streets. The classification helps to distinguish the influence of different road types on consumer movement patterns around each place.  
FS 6 (place-based features): This set includes the area of each Google POI's Voronoi cell, defining its spatial reach and the type of place (e.g., bar, cafe, or restaurant).  
Using the defined feature sets, a random forest classifier was conducted. The random_state parameter of our prediction model is explicitly set to 42 to ensure reproducibility. The rest of the key hyperparameters are as follows: 100 trees (n_estimators = 100), the Gini impurity criterion and the square root of the total features considered at each split. The data, which consists of 1582 POIs, is split into training (1265) and testing (317) datasets using an 80-20% split, with the random seed set to 42 for consistent partitioning [53].