Sequence learning-based bus passenger getting-off station prediction method and system
A bus passenger alighting point prediction model was constructed by using the LambdaMART algorithm based on ranking learning. By utilizing bus card swiping data and weather data, the problem of insufficient utilization of alighting point data in existing technologies was solved, thereby improving the accuracy of bus operation scheduling and passenger flow analysis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-15
- Publication Date
- 2026-04-03
AI Technical Summary
Existing technologies cannot effectively utilize data from drop-off points in the public transportation system, resulting in low accuracy in public transportation operation scheduling, route optimization, and passenger flow analysis. Furthermore, existing prediction methods ignore the spatial relationships between stations, leading to insufficient prediction stability and accuracy.
A ranking-based learning approach is adopted, and a bus passenger alighting station prediction model is constructed using the LambdaMART algorithm. By utilizing bus card swiping data and weather data, combined with the spatial relationships between stations, a ranking learning model is constructed, and feature prediction and parameter tuning are performed to improve prediction accuracy and stability.
It significantly improves the accuracy and stability of bus passenger drop-off point prediction, and can more effectively utilize the spatial relationship between stations, thereby improving the accuracy of bus operation scheduling and passenger flow analysis.
Smart Images

Figure CN121787638A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine learning technology, and in particular to a method and system for predicting bus passenger alighting points based on ranking learning. Background Technology
[0002] Currently, most city public transportation systems use open smart card systems that only record passengers' boarding station information and cannot directly obtain their alighting station information, making it impossible to fully construct a passenger origin-destination (OD) matrix. This data gap severely restricts the accuracy of public transportation operation scheduling, route optimization, and passenger flow analysis.
[0003] The relevant technologies mainly fall into two categories: one is manual on-board surveys, which are inefficient, costly, and difficult to conduct on a large scale and continuously; the other is rule-based inference methods, such as trip chain models. Trip chain models infer drop-off points by assuming passengers' continuous travel behavior, but their applicability is quite limited: they cannot infer for passengers who only travel once a day, and the inference results will be seriously distorted when passengers use private transportation between two public transport trips.
[0004] In recent years, with the development of machine learning technology, research has emerged that treats alighting station prediction as a multi-class classification problem, using models such as GBDT and XGBoost to directly predict which station a passenger will alight at. However, such methods treat each station as an independent category, ignoring the spatial order and distance relationships between stations, resulting in insufficient model prediction stability and a tendency for large prediction errors at some stations.
[0005] Therefore, the relevant technologies suffer from problems such as low prediction accuracy, poor stability, and limited ability to capture complex patterns of travel behavior. Summary of the Invention
[0006] To address the aforementioned technical problems, the present invention aims to provide a method and system for predicting bus passenger alighting points based on ranking learning, which can more effectively utilize the spatial relationships between points, thereby improving the accuracy and stability of prediction.
[0007] The first technical solution adopted in this invention is: a method for predicting bus passenger alighting points based on ranking learning, comprising the following steps: Obtain bus card swiping data and weather data, perform data preprocessing and data normalization, and construct a normalized feature matrix of the route to be predicted; A ranking learning model is constructed based on the normalized feature matrix of the line to be predicted; The LambdaMART algorithm is used to predict features of documents in the ranking learning model, perform index screening and parameter tuning, and obtain the prediction results of bus passenger alighting stations.
[0008] Furthermore, the step of acquiring bus card swiping data and weather data, performing data preprocessing and normalization, and constructing a normalized feature matrix of the route to be predicted specifically includes: Obtain bus card swiping data, which is passenger flow information, including route direction, boarding and alighting time, boarding and alighting route, and boarding and alighting station names; Acquire weather data, including air temperature and dew point temperature; The bus card swipe data is processed to remove duplicate and outlier values, and the route direction and boarding / alighting station names are mapped from strings to integers. The bus card swipe data is aggregated into hourly passenger flow data. At the same time, the card swipe date is used to determine whether the card swipe day is a holiday, and a holiday field is added in the form of 0-1 variables to construct passenger flow characteristic information. The northerly and easterly wind components in the weather data are obtained and combined with the dew point temperature in the weather data for conversion to obtain the relative humidity and relative wind speed. Obtain historical passenger flow time intervals and construct a feature dataset for the route to be predicted by combining passenger flow characteristic information, relative humidity and relative wind speed; Each travel record in the feature dataset of the route to be predicted is treated as a query, and all potential drop-off stations are treated as a document set. Each document is assigned a relevance label based on its distance from the actual drop-off station, and then normalized to obtain the normalized feature matrix of the route to be predicted.
[0009] Furthermore, the specific data set of features of the route to be predicted includes boarding card swiping date, boarding card swiping time, route number, route direction, boarding station name, alighting station name, whether it is a holiday, 1-hour passenger flow, 6-hour passenger flow, 24-hour passenger flow, temperature, hourly precipitation, relative wind speed and relative humidity.
[0010] Furthermore, the step of assigning a relevance label to each document based on the distance to the actual alighting station specifically includes: The document corresponding to the actual drop-off point has the largest tag value, denoted as l1; The tag values of documents for stations within the preset range corresponding to the actual drop-off station gradually decrease according to their distance from the actual drop-off station. The tag values of documents for stations after the actual drop-off station are recorded as l2, l3, l4 along the route. The document tag values for stations corresponding to the actual drop-off stations are recorded as l5 and l6 in reverse order of the route. The tag values for the remaining documents are 0.
[0011] Furthermore, the step of constructing a ranking learning model based on the normalized feature matrix of the line to be predicted specifically includes: Based on the normalized feature matrix of the route to be predicted, the data is divided according to the boarding station, route and direction of operation. Each bus card swipe data in the divided dataset corresponds to a query. Each query contains the same number of documents as the number of potential alighting stations corresponding to the route, direction and boarding station of the bus card swipe data. A ranking learning model is then constructed.
[0012] Furthermore, the step of using the LambdaMART algorithm to predict features of documents in the ranking learning model, perform indicator filtering and parameter tuning, and obtain the predicted bus passenger alighting station results specifically includes: The LambdaMART algorithm is used to predict the features of documents in the ranking learning model to obtain the predicted document order. Construct a multi-relevance ranking performance evaluation index to evaluate the predicted values of document order and select the document prediction results that meet the evaluation index; By using grid search and fast nondominated sorting methods with ERR and NDCG as dual objectives, the document prediction results were tuned to obtain the prediction results of bus passenger alighting stations.
[0013] Furthermore, the step of predicting the document order by using the LambdaMART algorithm to perform feature prediction on the documents in the ranking learning model specifically includes: The LambdaRank algorithm is used to define the document gradient in the ranking learning model, and the Lambda value of each document is calculated as the loss function based on the document gradient to construct the LambdaMART algorithm. The ranking learning model is iteratively initialized using the LambdaMART algorithm to construct a fitted regression tree; Based on the fitted regression tree, the tree nodes are divided by minimizing the sum of squared errors, generating a regression tree with a preset number of leaf nodes; A strong learner is constructed by calculating the value of each leaf node of a regression tree with a preset number of leaf nodes using Newton's iteration method and updating the fitted regression tree. The feature vectors of documents in the ranking learning model are scored by a strong learner, and the documents are ranked according to the scores to obtain the predicted document order.
[0014] Furthermore, the performance evaluation metrics for multi-relevance ranking specifically include the normalized cumulative gain with reduced loss metric, the expected inverse rank metric, and the normalized Kendall distance metric, wherein: The normalized loss cumulative gain index is used to evaluate the difference between the predicted relevance of drop-off stations and the actual relevance of drop-off stations; The expected inverse rank index is used to evaluate the quality of the prediction results for the relevance of drop-off stations. The normalized Kendall distance metric is used to evaluate document pairs that have mispredicted relevance relationships.
[0015] Furthermore, the step of tuning the document prediction results using grid search and fast non-dominated ranking methods with ERR and NDCG as dual objectives to obtain the bus passenger alighting station prediction results specifically includes: The grid search method is used to specify the list of values for each hyperparameter of the document prediction result, and the combination of values for the specified hyperparameters is exhaustively searched to obtain the final combination of hyperparameter values for the model. For all solutions with a value of 0 in the final model's hyperparameter combinations, assign a Pareto level of 1 and store these solutions in the first non-dominated set; For each solution in the first non-dominated set, subtract 1 from the count of each solution. If the count is 0 after subtraction, store it in the second non-dominated set and assign the corresponding solution a Pareto level of 2. Repeat the process of assigning Pareto levels until all solutions have been assigned Pareto levels, and output the predicted bus passenger alighting points.
[0016] The second technical solution adopted in this invention is: a bus passenger alighting station prediction system based on ranking learning, comprising: The first module is used to acquire bus card swiping data and weather data, perform data preprocessing and data normalization, and construct a normalized feature matrix of the route to be predicted. The second module is used to construct a ranking learning model based on the normalized feature matrix of the line to be predicted. The third module is used to predict the features of documents in the ranking learning model using the LambdaMART algorithm, as well as to perform index screening and parameter tuning, to obtain the predicted bus passenger alighting station results.
[0017] The beneficial effects of the method and system of this invention are as follows: This invention acquires bus card swiping data and weather data, performs data preprocessing and data normalization, constructs a normalized feature matrix of the route to be predicted, and adopts a training architecture divided by station-route-direction. This significantly improves training efficiency while ensuring the spatial rationality of the prediction results. Then, a ranking learning model is constructed based on the normalized feature matrix of the route to be predicted. Finally, the LambdaMART algorithm is used to predict the features of the documents in the ranking learning model, and index screening and parameter tuning are performed to obtain the prediction results of bus passenger alighting stations. By reconstructing the alighting station prediction from a multi-class problem to a ranking learning problem, the LambdaMART algorithm significantly improves the prediction accuracy and stability. By transforming the alighting station prediction problem from a traditional multi-class problem into a ranking problem, the spatial relationship between stations can be utilized more effectively, thereby improving the prediction accuracy and stability. Attached Figure Description
[0018] Figure 1 This is a flowchart illustrating the steps of a bus passenger alighting station prediction method based on ranking learning according to the present invention. Figure 2 This is a structural block diagram of a bus passenger alighting station prediction system based on ranking learning according to the present invention. Figure 3 This is a schematic diagram of a bus passenger alighting station prediction method provided in a specific embodiment of the present invention; Figure 4 This is a schematic diagram illustrating the actual principle and flow of the LambdaMART prediction method provided in a specific embodiment of the present invention; Figure 5 This is a schematic diagram of the solutions contained in the first four Pareto levels of the LambdaMART model parameter search provided in a specific embodiment of the present invention; Figure 6 This is a schematic diagram of bus routes 111, 204, and 877 provided in a specific embodiment of the present invention; Figure 7 This is a performance comparison diagram of different tag groups provided in a specific embodiment of the present invention; Figure 8 This is a schematic diagram comparing the performance of different feature groups provided in a specific embodiment of the present invention; Figure 9 This is a schematic diagram showing the performance comparison of random prediction results provided in a specific embodiment of the present invention. Detailed Implementation
[0019] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. The step numbers in the following embodiments are only for ease of explanation and do not limit the order of the steps. The execution order of each step in the embodiments can be adapted according to the understanding of those skilled in the art.
[0020] Reference Figure 1 and Figure 3 This invention provides a method for predicting bus passenger alighting points based on ranking learning, the method comprising the following steps: S100. Obtain bus card swiping data and weather data, perform data preprocessing and data normalization, and construct the normalized feature matrix of the route to be predicted. Specifically, the process involves: acquiring bus card swipe data, which is passenger flow information including route direction, boarding / alighting time, boarding / alighting route, and boarding / alighting stop names; acquiring weather data, including air temperature and dew point temperature; removing duplicates and outliers from the bus card swipe data, mapping the route direction and boarding / alighting stop names from strings to integers, aggregating the bus card swipe data into hourly passenger flow data, and determining whether the swipe date is a holiday by adding a holiday field as a 0-1 variable to construct passenger flow characteristic information; acquiring the northerly and easterly wind components from the weather data and converting them in conjunction with the dew point temperature to obtain relative humidity and relative wind speed; acquiring historical passenger flow time intervals and constructing a target route feature dataset by combining passenger flow characteristic information, relative humidity, and relative wind speed; treating each travel record in the target route feature dataset as a query, treating all corresponding potential alighting stops as a document set, assigning a correlation label based on the distance to the actual alighting stop to each document, and performing normalization processing to obtain a normalized target route feature matrix.
[0021] The characteristic data of the route to be predicted include the current test time, whether it is a holiday, the current temperature, the current rainfall, wind speed, relative humidity, and passenger flow.
[0022] The process of assigning relevance labels is as follows: the document corresponding to the actual drop-off point has the highest label value, denoted as l1; the label values of documents corresponding to stations near the actual drop-off point gradually decrease according to their distance from the actual drop-off point; the label values of documents corresponding to stations after the actual drop-off point are denoted as l2, l3, l4 along the route; the label values of documents corresponding to stations before the actual drop-off point are denoted as l5, l6 in the opposite direction of the route; the label values of the remaining documents are 0.
[0023] S200. Construct a ranking learning model based on the normalized feature matrix of the line to be predicted. Specifically, based on the normalized feature matrix of the route to be predicted, the data is divided according to the boarding station, route and direction of operation. Each bus card swipe data in the divided dataset corresponds to a query. Each query contains the same number of documents as the number of potential alighting stations corresponding to the route, direction and boarding station of the bus card swipe data. A ranking learning model is then constructed.
[0024] In this embodiment, the dataset is divided and constructed according to the following method: the dataset is divided according to the boarding station, route, and direction of travel. Each smart card data entry in the divided dataset corresponds to one query. Each query contains the same number of documents as the route, direction, and boarding station of this smart card data entry, with the number of potential alighting stations determined by the boarding station and the vehicle's direction of travel. In the feature vector of each document corresponding to a query, all feature values except for the alighting station are identical, representing the personalized features of this query. The feature values of the alighting stations in different documents cover all potential alighting stations for that query.
[0025] S300: The LambdaMART algorithm is used to predict the features of documents in the ranking learning model, and index screening and parameter tuning are performed to obtain the prediction results of bus passenger alighting stations.
[0026] S310. Use the LambdaMART algorithm to predict the features of documents in the ranking learning model to obtain the predicted document order. Specifically, the LambdaRank algorithm is used to define the document gradient in the ranking learning model, and the Lambda value of each document is calculated as the loss function based on the document gradient to construct the LambdaMART algorithm. The LambdaMART algorithm is used to iteratively initialize the ranking learning model to construct a fitted regression tree. Based on the fitted regression tree, the tree nodes are divided by minimizing the sum of squared errors to generate a regression tree with a preset number of leaf nodes. The Newton iteration method is used to calculate the value of each leaf node of the regression tree with a preset number of leaf nodes and update the fitted regression tree to construct a strong learner. The strong learner scores the feature vectors of the documents in the ranking learning model and sorts the documents according to the scores to obtain the predicted value of the document order.
[0027] In this embodiment, LambdaMART consists of MART (i.e., GBDT) and LambdaRank. MART is the underlying training model, defining the framework for tree generation, while LambdaRank defines the gradient for MART. LambdaRank does not solve the ranking problem using the traditional method of first calculating the loss function and then the gradient; instead, it directly defines the gradient. For each document pair, the gradient is defined as:
[0028] in, Let be the set of document indexes, for any There is documentation. ; and They represent and The score is derived through MART, and the initial value is usually set to 0. The higher the score, the higher the document's ranking position. It is the parameter of the sigmoid function; The change in the value of an evaluation metric (such as NDCG) caused by swapping the positions of two documents.
[0029] Then, each document is calculated. Lambda value:
[0030] Using Lambda as the gradient of the loss function and combining it with MART, we obtain LambdaMART. The specific algorithm process for each query is as follows: First, such as Figure 4 As shown, perform initialization:
[0031] in, , This represents the number of documents. If there is no base model to load, set it to all zeros. For document eigenvectors.
[0032] Subsequently, after M iterations, M trees are generated, and on the... In the next iteration: 1) Calculate the gradient and its derivative:
[0033]
[0034] 2) According to Fit a regression tree, partitioning the tree nodes to minimize the sum of squared errors, generating a leaf node with a total number of nodes. regression tree .
[0035] 3) Use Newton's iteration method to calculate the value of each leaf node:
[0036] 4) Update the regression tree:
[0037] in This is the learning rate. Output score This is used for gradient calculation in the next iteration.
[0038] Finally, a strong learner is obtained:
[0039] This learner can score documents based on their feature vectors and sort them according to the scores, thus obtaining a predicted document order.
[0040] S320. Construct a multi-relevance ranking performance evaluation index to evaluate the predicted values of document order and select the document prediction results that meet the evaluation index. In this embodiment, the relevance evaluation index specifically includes: Normalized Discounted Cumulative Gain (NDCG) is calculated based on the first K returned results and is typically used to measure and evaluate the performance of ranking algorithms. For each smart card data point, this model returns the relevance of each potential drop-off point for that data point, with a length of K. NDCG@K is then used to evaluate the difference between the predicted drop-off point relevance and the actual drop-off point relevance for that smart card data point.
[0041]
[0042]
[0043] in, This indicates the sorting position of all potential drop-off stations after they are sorted by predictive relevance from largest to smallest. Indicates ranking in The location of the drop-off point is searchable. Relevance; This indicates the sorting order of each alighting station from highest to lowest based on its actual relevance. The maximum possible value. This method yields the NDCG value for each smart card data prediction result, and then their arithmetic mean is calculated as the model's NDCG value. When The value in In between, It exhibits a negative correlation characteristic; Expected Inverse Rank (ERR) is an evaluation metric based on a cascaded model. It aims to address the shortcoming of NDCG (Non-Discretionary Card Coding) in not considering the influence of earlier-ranked results. In the ERR evaluation system, earlier-ranked results contribute significantly to the total score, while later-ranked results contribute very little. For each smart card data point, this model returns the relevance of all potential drop-off points for that data point, with a length of K. ERR@K can then be used to evaluate the quality of the smart card data's drop-off point relevance prediction results.
[0044]
[0045] in, This indicates that all potential drop-off stations, after being sorted from highest to lowest predictive relevance, are ranked as follows: The score for the alighting station; Indicates ranking in The relevance of potential drop-off stations to the location in this model. .
[0046] This method allows us to obtain the ERR value of each smart card data prediction result, and then calculate their arithmetic mean as the model's ERR value.
[0047] Normalized Kendall distance ( This reflects the proportion of document pairs with incorrect relevance predictions out of all document pairs, i.e., the prediction error rate. A document pair with incorrect relevance prediction means that the actual relevance relationship between the two documents in the pair does not match the predicted relevance relationship. For example, consider document 1 and document 2. If their actual relevance relationship is that document 1 is more relevant than document 2, but the prediction result is that document 2 is more relevant than document 1, then this document pair is called a document pair with incorrect relevance prediction. The calculation method is as follows:
[0048] in, Indicates the number of documents; This represents the number of document pairs that incorrectly predict the relevance relationship among all document pairs.
[0049] S330. By using grid search and fast non-dominated sorting methods with ERR and NDCG as dual objectives, the document prediction results are adjusted to obtain the bus passenger alighting station prediction results.
[0050] Specifically, a grid search method is used to specify the list of hyperparameter values for the document prediction results. The combinations of specified hyperparameter values are exhaustively enumerated to obtain the final model's hyperparameter value combinations. For all solutions with a value of 0 in the final model's hyperparameter value combinations, a Pareto level of 1 is assigned, and these solutions are stored in the first non-dominated set. For each solution in the first non-dominated set, the quantity of each solution is subtracted by 1. If the result is 0 after subtraction, the solution is stored in the second non-dominated set, and a Pareto level of 2 is assigned to the corresponding solution. This process of assigning Pareto levels is repeated until all solutions are assigned Pareto levels, and the prediction results for bus passenger alighting stations are output.
[0051] In this embodiment, the grid search method exhaustively searches for all possible combinations of hyperparameter values by pre-specifying a list of values for each hyperparameter. It then performs model training and performance evaluation on each of these combinations and finally gives the hyperparameter value combination with the best model performance as the final model's hyperparameter value combination.
[0052] The fast non-dominated sort, specifically, aims to divide the solution set into Pareto fronts of different levels. Lower-level Pareto fronts contain better solutions. For each solution in the solution set... , will dominate The number of solutions is denoted as will be The set of dominant solutions is denoted as The steps of quick nondominated sort are as follows: 1) For all solutions in the solution set The solutions are assigned a Pareto level of 1 and stored in the non-dominated set. middle; 2) For sets Each solution in ,Will Each solution of Subtract 1, if Then Store in non-dominated solution set In the middle, and assign these solutions a Pareto level 2; 3) To Repeat the above operation for all solutions until all solutions have been assigned a Pareto level.
[0053] Thus, the solution set is divided into Pareto fronts at different levels, and the set... The solutions contained therein constitute the Pareto front of the i-th level; The random result is as follows: for each piece of smart card data, six potential drop-off stations are randomly selected (if there are fewer than six potential drop-off stations, all drop-off stations are selected), and a correlation score of 5, 4, 3, 2, 1, and 1 is assigned as the prediction correlation score in sequence. The remaining potential drop-off stations are assigned a correlation score of 0, thus obtaining a random prediction result with a structure consistent with the model used in this study.
[0054] Therefore, in this embodiment of the invention, the bus card swiping data is first derived from OD back-calculation, and the bus card swiping data includes passenger flow information such as boarding time, boarding route, and boarding stop; the weather data is obtained from the European Centre for Medium-Range Weather Forecasts' Generation 5 Atmospheric Reanalysis Dataset (ERA5), including information such as air temperature and dew point temperature. The bus card swiping data is preprocessed to remove duplicate and abnormal data, map the route direction and boarding / alighting stop names from strings to integers, extract passenger flow characteristic information, and aggregate the bus card swiping data into hourly passenger flow data. Simultaneously, based on the card swiping date, it is determined whether the card swiping day is a holiday, and a holiday field is added in the form of 0-1 variables. The weather data is preprocessed, and the dew point temperature tp, the northward component windv of 10-meter wind, and the eastward component windu of 10-meter wind are converted into relative humidity hum and wind speed wind. Based on the location of the route to be predicted, historical passenger flow time intervals, and weather data, a feature dataset for the route to be predicted is obtained, a feature matrix is established, and normalization processing is performed. The feature dataset for the route to be predicted includes: boarding card swipe date, boarding card swipe time, route number, route direction, boarding station name, alighting station name, whether it is a holiday, 1-hour passenger flow, 6-hour passenger flow, 24-hour passenger flow, temperature, hourly precipitation, wind speed, and relative humidity. Each travel record is treated as a query, and all potential alighting stations corresponding to that travel are treated as a document set. Each document is assigned a relevance label based on its distance from the actual alighting station. A ranking learning model was constructed; passenger flow data was divided into a training set, and the LambdaMART algorithm was used to train the training set. Then, the passenger flow of the test set during the prediction period was predicted to obtain the prediction results; three multi-relevance ranking performance evaluation indicators were used as the evaluation criteria for the model; grid search and fast non-dominated ranking methods were used to tune the model's boosting tree number, learning rate, maximum tree depth, and maximum number of leaf nodes with ERR and NDCG as dual objectives; several sets of label values and feature group values were compared to determine the final dataset; the comprehensive performance differences in solving the problem of predicting the same bus passenger alighting point were compared with random results and classification models.
[0055] In summary, this invention significantly improves prediction accuracy and stability by refactoring drop-off station prediction from a multi-class classification problem to a ranking learning problem and utilizing the LambdaMART algorithm. It innovatively integrates travel information, dynamic passenger flow, and weather data, and adopts a training architecture divided by station-route-direction, which greatly improves training efficiency while ensuring the spatial rationality of prediction results, effectively overcoming the shortcomings of traditional methods such as large error fluctuations and insufficient feature utilization.
[0056] Finally, the embodiments of the present invention will be explained and described in conjunction with the accompanying drawings: like Figure 5 as well as Figure 6 As shown, this invention selects three actual bus routes—routes 111, 204, and 877—from a certain city in 2021 for verification. The routes 111, 204, and 877 consist of 37, 29, and 36 stops respectively. The topology of the bus routes is as follows... Figure 3 As shown in Table 1, these three bus routes have different characteristics. In terms of route features, Route 111 is a long-distance route with sparse stops in the suburbs, Route 204 is a short-distance route with dense stops passing through the central urban area, and Route 877 is a long-distance route with dense stops connecting the central urban area and Suzhou North High-speed Railway Station. In terms of the main purpose of the routes, Route 111 and Route 204 are commuter routes, while Route 877 mainly meets the needs of daily travel and tourism.
[0057] Table 1 Passenger flow data for three actual bus routes ; Bus passenger flow over a given time period is influenced by a range of factors, such as basic travel information, passenger volume data, and weather. The impact of each factor can be significantly different. In addition to smart card data, other attributes, such as weekday / holiday and school day / holiday information, can be easily collected from announcements from relevant departments. Historical weather information, for example, can be obtained through local historical weather records.
[0058] In practical applications, features exhibit heterogeneity. Some features are continuous numerical variables, while others are discrete categorical variables. Discrete variables should be converted to numbers to facilitate algorithmic operations; for example, whether it is a holiday is represented by 0 and 1. This invention introduces three potential external factors, and the data description and processing methods are discussed below: The first category is passenger flow. Passenger flow is the core dynamic feature for predicting bus passenger alighting points. It profoundly affects prediction accuracy through three mechanisms: First, historical passenger flow patterns reveal the functional attributes of stations (such as commuter hubs, commercial areas, and residential areas) and time-period characteristics, enabling the model to identify typical travel purposes. Second, real-time passenger flow peaks not only indicate an increased probability of "missing the stop" due to increased vehicle crowding but also reflect abnormal travel patterns caused by special events. Finally, passenger flow baselines for different routes characterize the differences in travel habits among passenger groups (such as the regularity of commuters versus the randomness of tourists). 1-hour passenger flow represents the most real-time operational status. A very high 1-hour passenger flow strongly suggests that the current vehicle may be very crowded. This directly affects passenger behavior: in a crowded vehicle, passengers have difficulty moving, which may prevent them from getting off at their target stop in time, thus "being forced to miss the stop." Therefore, when the model sees a high 1-hour passenger flow, it tends to slightly adjust the predicted alighting point backward (away from the boarding point). Daily passenger flow, on the other hand, represents long-term, cyclical patterns.
[0059] The second category of influencing factors is weather, such as temperature, hourly precipitation, wind speed, and relative humidity. These meteorological conditions directly affect people's perceived comfort and travel decisions, influencing their choice of a stop. The mechanism of their effect is as follows: Air temperature and relative humidity together determine perceived temperature. In hot and humid weather or cold and damp weather, passengers' energy expenditure and tolerance decrease. This prompts them to shorten walking distances, tend to get off at closer stations that provide quicker access to their destination, or disembark early to transfer to sheltered areas. Conversely, suitable temperature and humidity increase passengers' tolerance for longer walking distances. Hourly precipitation is the most direct weather factor. Rainfall, especially sudden moderate to heavy rain, significantly alters passenger behavior. Passengers with rain gear will want to get off as soon as possible to avoid the rain, while those without may choose to "skip their stop" and remain on the train until they reach a sheltered transfer hub, a large shopping mall, or a station closer to their final destination, thus minimizing their exposure time in the rain. Windy weather, especially when accompanied by low temperatures, exacerbates the wind chill effect, making the perceived temperature even lower. Similar to hot and humid weather, this reduces passengers' comfort and willingness to stay outdoors, leading them to choose to get off at stations with less wind resistance and a quicker access to indoor environments, avoiding long walks in open areas.
[0060] The third category is related to holidays, including weekends or statutory holidays. Certain holidays (such as Labor Day and National Day) will have a significant impact on passenger flow in specific areas, resulting in explosive demand drops or increases. The following table summarizes the datasets containing all characteristics, as shown in Table 2.
[0061] Table 2 Dataset of features of the lines to be predicted ; To verify that the improved ranking learning model (LambdaMART) of this invention has higher prediction accuracy and advantages compared with traditional machine learning classification models, the GBDT model and XGBoost model were selected for comparison. Their basic statistical characteristics, including the predicted cross-sectional passenger flow versus the actual cross-sectional passenger flow, the error in predicted cross-sectional passenger flow, and the absolute value of the relative error of passenger flow at each predicted cross-section, were analyzed. The comparison results are as follows: Figure 7 , Figure 8 , Figure 9 As shown.
[0062] Reference Figure 2 A bus passenger alighting stop prediction system based on ranking learning includes: The first module 201 is used to acquire bus card swiping data and weather data, perform data preprocessing and data normalization, and construct a normalized feature matrix of the route to be predicted. The second module 202 is used to construct a ranking learning model based on the normalized feature matrix of the line to be predicted. The third module 203 is used to predict the features of documents in the ranking learning model and perform index screening and parameter tuning using the LambdaMART algorithm to obtain the prediction results of bus passenger alighting stations.
[0063] The content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0064] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.
Claims
1. A method for predicting bus passenger alighting points based on ranking learning, characterized in that, Includes the following steps: Obtain bus card swiping data and weather data, perform data preprocessing and data normalization, and construct a normalized feature matrix of the route to be predicted; A ranking learning model is constructed based on the normalized feature matrix of the line to be predicted; The LambdaMART algorithm is used to predict features of documents in the ranking learning model, perform index filtering and parameter tuning, and obtain the predicted bus passenger alighting station results.
2. The method for predicting bus passenger alighting points based on ranking learning according to claim 1, characterized in that, The step of acquiring bus card swiping data and weather data, performing data preprocessing and normalization, and constructing a normalized feature matrix of the route to be predicted specifically includes: Obtain bus card swiping data, which is passenger flow information, including route direction, boarding and alighting time, boarding and alighting route, and boarding and alighting station names; Acquire weather data, including air temperature and dew point temperature; The bus card swipe data is processed to remove duplicate and outlier values, and the route direction and boarding / alighting station names are mapped from strings to integers. The bus card swipe data is aggregated into hourly passenger flow data. At the same time, the card swipe date is used to determine whether the card swipe day is a holiday, and a holiday field is added in the form of 0-1 variables to construct passenger flow characteristic information. The northerly and easterly wind components in the weather data are obtained and combined with the dew point temperature in the weather data for conversion to obtain the relative humidity and relative wind speed. Obtain historical passenger flow time intervals and construct a feature dataset for the route to be predicted by combining passenger flow characteristic information, relative humidity, and relative wind speed. Each travel record in the feature dataset of the route to be predicted is treated as a query, and all potential drop-off stations are treated as a document set. Each document is assigned a relevance label based on its distance from the actual drop-off station, and then normalized to obtain the normalized feature matrix of the route to be predicted.
3. The method for predicting bus passenger alighting points based on ranking learning according to claim 2, characterized in that, The specific data set of features of the route to be predicted includes boarding card swiping date, boarding card swiping time, route number, route direction, boarding station name, alighting station name, whether it is a holiday, 1-hour passenger flow, 6-hour passenger flow, 24-hour passenger flow, temperature, hourly precipitation, relative wind speed and relative humidity.
4. The method for predicting bus passenger alighting points based on ranking learning according to claim 3, characterized in that, The step of assigning each document a relevance label based on the distance to the actual drop-off point specifically includes: The document corresponding to the actual drop-off point has the largest tag value, denoted as l1; The tag values of documents for stations within the preset range corresponding to the actual drop-off station gradually decrease according to their distance from the actual drop-off station. The tag values of documents for stations after the actual drop-off station are recorded as l2, l3, l4 along the route. The document tag values for stations corresponding to the actual drop-off stations are denoted as l5 and l6 in reverse order of the route. The tag values for the remaining documents are 0.
5. The method for predicting bus passenger alighting points based on ranking learning according to claim 4, characterized in that, The step of constructing a ranking learning model based on the normalized feature matrix of the line to be predicted specifically includes: Based on the normalized feature matrix of the route to be predicted, the data is divided according to the boarding station, route and direction of operation. Each bus card swipe data in the divided dataset corresponds to a query. Each query contains the same number of documents as the number of potential alighting stations corresponding to the route, direction and boarding station of the bus card swipe data. A ranking learning model is then constructed.
6. The method for predicting bus passenger alighting points based on ranking learning according to claim 5, characterized in that, The step of using the LambdaMART algorithm to predict features of documents in the ranking learning model, perform indicator filtering and parameter tuning, and obtain the predicted bus passenger alighting station results specifically includes: The LambdaMART algorithm is used to predict the features of documents in the ranking learning model to obtain the predicted document order. Construct a multi-relevance ranking performance evaluation index to evaluate the predicted values of document order and select the document prediction results that meet the evaluation index; By using grid search and fast nondominated sorting methods with ERR and NDCG as dual objectives, the document prediction results were tuned to obtain the prediction results of bus passenger alighting stations.
7. The method for predicting bus passenger alighting points based on ranking learning according to claim 6, characterized in that, The step of predicting document order by using the LambdaMART algorithm to perform feature prediction on documents in the ranking learning model specifically includes: The LambdaRank algorithm is used to define the document gradient in the ranking learning model, and the Lambda value of each document is calculated as the loss function based on the document gradient to construct the LambdaMART algorithm. The ranking learning model is iteratively initialized using the LambdaMART algorithm to construct a fitted regression tree; Based on the fitted regression tree, the tree nodes are divided by minimizing the sum of squared errors, generating a regression tree with a preset number of leaf nodes; A strong learner is constructed by calculating the value of each leaf node of a regression tree with a preset number of leaf nodes using Newton's iteration method and updating the fitted regression tree. The feature vectors of documents in the ranking learning model are scored by a strong learner, and the documents are ranked according to the scores to obtain the predicted document order.
8. The method for predicting bus passenger alighting points based on ranking learning according to claim 7, characterized in that, The performance evaluation metrics for multi-correlation ranking specifically include the normalized cumulative gain with reduced loss metric, the expected inverse rank metric, and the normalized Kendall distance metric, wherein: The normalized loss cumulative gain index is used to evaluate the difference between the predicted relevance of drop-off stations and the actual relevance of drop-off stations; The expected inverse rank index is used to evaluate the quality of the prediction results for the relevance of drop-off stations. The normalized Kendall distance metric is used to evaluate document pairs that have mispredicted relevance relationships.
9. The method for predicting bus passenger alighting points based on ranking learning according to claim 8, characterized in that, The step of tuning the document prediction results using grid search and fast non-dominated sorting methods with ERR and NDCG as dual objectives to obtain the predicted bus passenger alighting points specifically includes: The grid search method is used to specify the list of values for each hyperparameter of the document prediction result, and the combination of values for the specified hyperparameters is exhaustively searched to obtain the final combination of hyperparameter values for the model. For all solutions with a value of 0 in the combination of hyperparameter values of the final model, assign a Pareto level of 1 and store these solutions in the first non-dominated set; For each solution in the first non-dominated set, subtract 1 from the count of each solution. If the count is 0 after subtraction, store it in the second non-dominated set and assign the corresponding solution a Pareto level of 2. Repeat the process of assigning Pareto levels until all solutions have been assigned Pareto levels, and output the predicted bus passenger alighting points.
10. A bus passenger alighting stop prediction system based on ranking learning, characterized in that, Includes the following modules: The first module is used to acquire bus card swiping data and weather data, perform data preprocessing and data normalization, and construct a normalized feature matrix of the route to be predicted. The second module is used to construct a ranking learning model based on the normalized feature matrix of the line to be predicted. The third module is used to predict the features of documents in the ranking learning model using the LambdaMART algorithm, as well as to perform index screening and parameter tuning, to obtain the predicted bus passenger alighting station results.