Urban management patrol site recommendation method based on random forest algorithm

Through the combination of the random forest algorithm and the DBSCAN algorithm, the existing technology solves the problem of regional differences and neglect of time and environmental factors in the urban management patrol location recommendation, achieves more accurate and comprehensive event prediction and patrol location recommendation, and improves the science of patrol strategies. sex and efficiency.

CN118656534APending Publication Date: 2024-09-17NANJING LES INFORMATION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410685307.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

Existing urban management patrol location recommendation methods based on human flow prediction ignore regional differences and the comprehensive impact of time and environmental factors, resulting in a lack of comprehensiveness and accuracy in the recommendation results.

Method used

The random forest algorithm is used to preprocess and feature engineering the urban management historical data, combined with the DBSCAN algorithm for data clustering, a sliding time window cross-validation model is constructed, weather conditions and special event markers are considered, and event prediction and patrol location recommendation are optimized.

Benefits of technology

It improves the accuracy and comprehensiveness of patrol location recommendations, helps law enforcement officers develop scientific and efficient patrol routes, and pays more attention to areas where cases frequently occur.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656534A
    Figure CN118656534A
Patent Text Reader

Abstract

The invention discloses an urban management patrol site recommendation method based on a random forest algorithm. The method comprises the following steps: preprocessing urban management historical data; performing feature engineering on the preprocessed data to improve the accuracy of the model; constructing and training a random forest algorithm model; using a sliding time window to perform cross validation to evaluate the accuracy of the model, and adjusting the model according to an evaluation result to optimize the performance; and predicting a plurality of clusters by using the optimized model to obtain the number of predicted events of each cluster within one hour in the future, and recommending the urban management patrol site based on the prediction result. According to the method, the number of events is taken as a starting point, the number of events in a certain region is predicted based on the random forest algorithm, the law and influence factors of event occurrence can be captured more comprehensively, and more reliable data support is provided for urban management patrol.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of urban management, and in particular relates to a method for recommending urban management patrol locations based on a random forest algorithm. Background Art

[0002] Currently, there is a method to predict the flow of people at a certain location through deep learning models. This method is mainly used in large-scale events or crowded places to help organizers and law enforcement agencies effectively manage crowds.

[0003] The current method of recommending patrol locations based on crowd flow prediction has some obvious flaws. First, the method oversimplifies the selection of locations and relies solely on the overall crowd flow, while ignoring the unique differences that may exist between different regions. Each region has its own unique resident activity patterns and cultural customs, and these factors should be fully considered in the selection of patrol locations. Second, the method does not fully consider the impact of factors such as time and environment on criminal activities. The formulation of patrol strategies should comprehensively consider time and seasonal changes, weather conditions, special times, etc., in order to more fully understand the impact of these factors on data. The above technical deficiencies make the recommendation results lack comprehensiveness.

[0004] Therefore, the existing technology ignores regional differences in location recommendation and fails to fully consider the combined influence of factors such as time and environment, which affects the accuracy of patrol location recommendation. Summary of the invention

[0005] In view of the above-mentioned deficiencies in the prior art, the purpose of the present invention is to provide a method for recommending urban management patrol locations based on a random forest algorithm, so as to solve the problem that the recommendation results of urban management patrol locations in the prior art are inaccurate and lack comprehensiveness. The method of the present invention takes the number of events as the starting point, and predicts the number of events in a certain area based on a random forest algorithm, which can more comprehensively capture the laws and influencing factors of event occurrence, and provide more reliable data support for urban management patrols.

[0006] To achieve the above object, the technical solution adopted by the present invention is as follows:

[0007] A method for recommending urban management patrol locations based on a random forest algorithm of the present invention comprises the following steps:

[0008] 1) Data processing: pre-processing of urban management historical data;

[0009] 2) Feature Engineering: Perform feature engineering on the preprocessed data to improve the accuracy of the model, including feature selection, feature processing, and generating new features;

[0010] 3) Model construction: Use the features obtained in step 2) to build and train the random forest algorithm model;

[0011] 4) Model evaluation and adjustment: Use sliding time window cross-validation to evaluate the accuracy of the model, and adjust the model based on the evaluation results to optimize performance;

[0012] 5) Event prediction: Use the optimized model to predict multiple clusters and obtain the number of events predicted to occur in each cluster within the next hour. Based on the prediction results, recommend patrol locations for urban management.

[0013] Furthermore, the preprocessing in step 1) specifically includes: data cleaning, setting weights of different types of events, and clustering the data using the DBSCAN algorithm;

[0014] 11) Data cleaning, including: missing value processing and data legitimacy verification;

[0015] Missing value processing: For missing values ​​in the urban management historical data, corresponding strategies are used to process them. If the latitude, longitude, and time fields are missing, the data is removed; if the event type field is missing, it is filled with a common event, and its weight is set to 1 in the subsequent weight setting;

[0016] Data legitimacy verification: Verify whether the longitude and latitude of the event deviate from the current city. If so, it is considered abnormal data and cleared.

[0017] 12) Set weights for different types of events and get the weight W of the nth type n ;

[0018] 13) Use the DBSCAN algorithm to cluster the data: set the cluster radius ε and the density threshold MinPts, and use the DBSCAN algorithm to cluster to obtain d clusters and the event data set E on each cluster. d ; The specific steps are as follows:

[0019] 131) Randomly select an unlabeled event p from the urban management event dataset E;

[0020] 132) Traverse all data points except p, calculate the distance from each data point to p, if the distance is less than the clustering radius ε, the data point is in the domain of event p, if the distance is greater than the clustering radius ε, the data point is outside the domain of event p; determine whether the number of events within the clustering radius ε of event p is greater than the density threshold MinPts, if greater, then classify event p and the events within the clustering radius ε of its domain as cluster D1, and mark event p as a core object, otherwise mark it as a noise object;

[0021] 133) Traverse the unmarked events in cluster D1 and perform the method of step 132) on them. If the number of events within the domain clustering radius ε is greater than the density threshold MinPts, then all related events are classified into cluster D1; until the number of events within the domain clustering radius ε of any event in cluster M1 is less than the density threshold MinPts, then the event data set E1 on cluster D1 is obtained;

[0022] 134) Repeat steps 131) to 133), and finally all events are classified into a certain cluster or marked as noise objects;

[0023] The events on a single cluster are grouped by hour to obtain the collection of events in each time period, as follows:

[0024] E d,t ={e i |e i ∈E d ,time(e i )=t}

[0025] Among them, E d,t represents the set of events that occur in cluster d at time t, e i Indicates E d An event in time(e i ) represents event e i Time of occurrence;

[0026] Combined with the weight W of the event type n , get the weighted total number of events N that occurred in a single hour d,t :

[0027] N d,t =∑e i ∈E d,t ·weight(e i )

[0028] Among them, weight(e i ) represents event e i The weight of the event type.

[0029] Furthermore, the step 2) specifically includes:

[0030] 21) Evaluate the importance of features, remove features that have little impact on the number of events, and use the Pearson correlation coefficient to evaluate the correlation between features and the number of events:

[0031]

[0032] Among them, x i and iare the number of urban management events in a day and the eigenvalues ​​corresponding to the required evaluation features, and They are the mean of the number of urban management events and the mean of the characteristic values ​​of the required evaluation features;

[0033] The value range of γ is between -1 and 1, where 1 indicates a perfect positive correlation, -1 indicates a perfect negative correlation, and 0 indicates no correlation;

[0034] When performing feature selection, list the features that affect the number of events, use the Pearson correlation coefficient to evaluate the correlation between the features and the number of events, and select features with high correlation for subsequent model construction;

[0035] 22) When performing feature processing, the features are divided into numerical features, categorical features and time features, and different processing methods are adopted for different types of features; for numerical features, the original values ​​are used, specifically to make the features have different scales or variance differences; for categorical features, the feature values ​​are converted into a numerical form that can be used by the model using one-hot encoding, and each non-numerical feature is converted into a binary vector, in which only one element is 1, indicating the existence of the corresponding feature value, and the other elements are 0; for time features, the time is split into year, month, day, and hour, and four features are obtained after the split.

[0036] Furthermore, the step 3) specifically includes:

[0037] The features obtained in step 2) are used as output to construct the feature vector X. The number of samples in the urban management dataset is set to m, and the number of features is set to n. The urban management dataset is represented by the matrix X m×n , where each row represents a sample and each column represents a feature, as follows:

[0038]

[0039] Define the weighted total number of events occurring per hour as the target variable Y, and the target variable vector is Y m×1 ;

[0040]

[0041] The constructed feature vector X and target variable Y are used to train the random forest model. The training process of the random forest is expressed by the following formula:

[0042]

[0043] Among them, Y pred represents the model's prediction of the target variable, N represents the number of decision trees, and f i (X) represents the prediction of the i-th decision tree.

[0044] Furthermore, the step 4) specifically includes:

[0045] 41) The pre-processed urban management historical data is divided into multiple time windows in chronological order, each time window contains data of a certain length; in each time window, a part of the data is used for model training, and another part of the data is used to evaluate the performance of the model. This process is performed on the entire historical data by sliding the time window to simulate the performance of the model in different time periods;

[0046] 42) For a single time window, the data is divided into a training set and a test set. After building a model with the training set, the root mean square error is used to evaluate the accuracy of a single model:

[0047]

[0048] Among them, RMSE is the root mean square error, y i represents the true target value, represents the predicted value of the model;

[0049] After evaluating the models in all time windows, the mean square error (MSE) is used to obtain the final evaluation result:

[0050]

[0051] Among them, RMSE(i) represents the root mean square error of the model in the i-th time window;

[0052] By evaluating the performance of the model in different time windows, the temporal stability and generalization of the model can be obtained; based on the evaluation results, the various parameters of the model are adjusted until the output results meet the requirements.

[0053] Furthermore, the step 5) specifically includes:

[0054] A cyclic process of modeling, evaluating, and optimizing each cluster independently;

[0055] After modeling, evaluating, and optimizing a single cluster, we obtain the event quantity prediction model for this cluster. The time to be predicted is input into the optimized model in step 4) to obtain the event quantity prediction N for the dth cluster at that time. d,t ;

[0056] The 10 locations with the largest number of predicted events are recommended patrol locations.

[0057] Beneficial effects of the present invention:

[0058] The method of the present invention uses the processing of urban management historical data as a training set, and introduces features such as weather conditions and special event markers to construct a random forest model for training. The selection of multiple characteristic values ​​makes the prediction results more comprehensive and accurate. When processing the data, a weighted method is used to calculate the total number of events, so that some special event types have a greater impact on the prediction results, and the prediction results will be more in line with expectations; taking into account the differences in social environment and event characteristics in different locations, the DBSCAN algorithm is used to divide the data set into multiple clusters, and different clusters are modeled and predicted respectively to obtain a prediction of the number of events that will occur in the location in the future, helping law enforcement personnel to formulate more scientific and efficient patrol routes, so that some cases with a fast growth rate and frequent cases that are not easy to judge through experience are paid attention to. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 It is the principle diagram of the method of the present invention;

[0060] Figure 2 Schematic diagram of random forest in the present invention. DETAILED DESCRIPTION

[0061] In order to facilitate the understanding of those skilled in the art, the present invention is further described below in conjunction with embodiments and drawings. The contents mentioned in the implementation modes are not intended to limit the present invention.

[0062] Reference Figure 1 As shown, a method for recommending urban management patrol locations based on a random forest algorithm of the present invention comprises the following steps:

[0063] 1) Data processing: pre-processing of urban management historical data; specifically including: data cleaning, setting weights for different types of events, and clustering data using the DBSCAN algorithm;

[0064] 11) Data cleaning, including: missing value processing and data legitimacy verification;

[0065] Missing value processing: For missing values ​​in the urban management historical data, corresponding strategies are used to process them. If the latitude, longitude, and time fields are missing, the data is removed; if the event type field is missing, it is filled with a common event, and its weight is set to 1 in the subsequent weight setting;

[0066] Data legitimacy verification: Verify whether the longitude and latitude of the event deviate from the current city. If so, it is considered abnormal data and cleared.

[0067] 12) Set weights for different types of events and get the weight W of the nth type n ;

[0068] 13) Use the DBSCAN algorithm to cluster the data: set the cluster radius ε and the density threshold MinPts, and use the DBSCAN algorithm to cluster to obtain d clusters and the event data set E on each cluster. d ; The specific steps are as follows:

[0069] 131) Randomly select an unlabeled event p from the urban management event dataset E;

[0070] 132) Traverse all data points except p, calculate the distance from each data point to p, if the distance is less than the clustering radius ε, the data point is in the domain of event p, if the distance is greater than the clustering radius ε, the data point is outside the domain of event p; determine whether the number of events within the clustering radius ε of event p is greater than the density threshold MinPts, if greater, then classify event p and the events within the clustering radius ε of its domain as cluster D1, and mark event p as a core object, otherwise mark it as a noise object;

[0071] 133) Traverse the unmarked events in cluster D1 and perform the method of step 132) on them. If the number of events within the domain clustering radius ε is greater than the density threshold MinPts, then all related events are classified into cluster D1; until the number of events within the domain clustering radius ε of any event in cluster M1 is less than the density threshold MinPts, then the event data set E1 on cluster D1 is obtained;

[0072] 134) Repeat steps 131) to 133), and finally all events are classified into a certain cluster or marked as noise objects;

[0073] The events on a single cluster are grouped by hour to obtain the collection of events in each time period, as follows:

[0074] E d,t ={e i |e i ∈E d ,time(e i )=t}

[0075] Among them, E d,t represents the set of events that occur in cluster d at time t, e i Indicates E d An event in time(e i ) represents event e i Time of occurrence;

[0076] Combined with the weight W of the event type n , get the weighted total number of events N that occurred in a single hour d,t :

[0077] N d,t=∑e i ∈E d,t ·weight(e i )

[0078] Among them, weight(e i ) represents event e i The weight of the event type.

[0079] 2) Feature Engineering: Perform feature engineering on the preprocessed data to improve the accuracy of the model, including feature selection, feature processing, and generating new features; specifically, including:

[0080] 21) Evaluate the importance of features, remove features that have little impact on the number of events, and use the Pearson correlation coefficient to evaluate the correlation between features and the number of events:

[0081]

[0082] Among them, x i and i are the number of urban management events in a day and the eigenvalues ​​corresponding to the required evaluation features, and They are the mean of the number of urban management events and the mean of the characteristic values ​​of the required evaluation features;

[0083] The value range of γ is between -1 and 1, where 1 indicates a perfect positive correlation, -1 indicates a perfect negative correlation, and 0 indicates no correlation;

[0084] When performing feature selection, list the features that affect the number of events, use the Pearson correlation coefficient to evaluate the correlation between the features and the number of events, and select features with higher correlation for subsequent model construction;

[0085] 22) When performing feature processing, the features are divided into numerical features, categorical features, and time features, and different processing methods are adopted for different types of features; for numerical features (such as temperature and humidity), the original values ​​are used, specifically to make the features have different scales or variance differences; for categorical features (such as weather conditions, special time tags), one-hot encoding is used to convert the feature values ​​into a numerical form that can be used by the model. Each non-numeric feature is converted into a binary vector, in which only one element is 1, indicating the existence of the corresponding feature value, and the other elements are 0; for example, special time tags include weekdays, weekends, and holidays. After one-hot encoding, weekdays are encoded as 1, 0, 0; weekends are encoded as 0, 1, 0; and holidays are encoded as 0, 0, 1. In this way, the model can better understand and utilize these discrete non-numeric features; for time features, time is split into year, month, day, and hour, so that the model can better capture the periodicity, trend and other characteristics of time. For example, the time of the event is 2022-01-01 18:55:35, and four features are obtained after splitting: year (feature value is 2022), month (feature value is 01), day (feature value is 01), and hour (feature value is 18).

[0086] 3) Model construction: Use the features obtained in step 2) to build and train the random forest algorithm model; refer to Figure 2 As shown, specifically including:

[0087] The features obtained in step 2) are used as output to construct the feature vector X. The number of samples in the urban management dataset is set to m, and the number of features is set to n. The urban management dataset is represented by the matrix X m×n , where each row represents a sample and each column represents a feature, as follows:

[0088]

[0089] Define the weighted total number of events occurring per hour as the target variable Y, and the target variable vector is Y m×1 ;

[0090]

[0091] The constructed feature vector X and target variable Y are used to train the random forest model. The training process of the random forest is expressed by the following formula:

[0092]

[0093] Among them, Y pred represents the model's prediction of the target variable, N represents the number of decision trees, and f i (X) represents the prediction of the i-th decision tree.

[0094] 4) Model evaluation and adjustment: Use sliding time window cross-validation to evaluate the accuracy of the model, and adjust the model based on the evaluation results to optimize performance; specifically include:

[0095] 41) The pre-processed urban management historical data is divided into multiple time windows in chronological order, each time window contains data of a certain length; in each time window, a part of the data is used for model training, and another part of the data is used to evaluate the performance of the model. This process is performed on the entire historical data by sliding the time window to simulate the performance of the model in different time periods;

[0096] 42) For a single time window, the data is divided into a training set and a test set. After building a model with the training set, the root mean square error is used to evaluate the accuracy of a single model:

[0097]

[0098] Among them, RMSE is the root mean square error, y i represents the true target value, represents the predicted value of the model;

[0099] After evaluating the models in all time windows, the mean square error (MSE) is used to obtain the final evaluation result:

[0100]

[0101] Among them, RMSE(i) represents the root mean square error of the model in the i-th time window;

[0102] By evaluating the performance of the model in different time windows, the temporal stability and generalization of the model can be obtained; based on the evaluation results, the various parameters of the model are adjusted until the output results meet the requirements.

[0103] 5) Event prediction: Use the optimized model to predict multiple clusters and obtain the number of events predicted to occur in each cluster within the next hour. Based on the prediction results, recommend patrol locations for urban management. Specifically, it includes:

[0104] A cyclic process of modeling, evaluating, and optimizing each cluster independently;

[0105] After modeling, evaluating, and optimizing a single cluster, we obtain the event quantity prediction model for this cluster. The time to be predicted is input into the optimized model in step 4) to obtain the event quantity prediction N for the dth cluster at that time. d,t ;

[0106] The 10 locations with the largest number of predicted events are recommended patrol locations.

[0107] The present invention has many specific application paths. The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements can be made without departing from the principle of the present invention. These improvements should also be regarded as the protection scope of the present invention.

Claims

1. A method for recommending urban management patrol locations based on random forest algorithm, characterized in that: Here are the steps: 1) Preprocess the historical data of urban management; 2) Perform feature engineering on the preprocessed data to improve the accuracy of the model, including feature selection, feature processing, and generating new features; 3) Use the features obtained in step 2) to build and train a random forest algorithm model; 4) Use sliding time window cross-validation to evaluate the accuracy of the model and adjust the model based on the evaluation results to optimize performance; 5) Use the optimized model to predict multiple clusters and obtain the number of events predicted to occur in each cluster within the next hour. Based on the prediction results, recommend patrol locations for urban management.

2. The method for recommending urban management patrol locations based on random forest algorithm according to claim 1, characterized in that: The preprocessing in step 1) specifically includes: data cleaning, setting weights of different types of events, and clustering the data using the DBSCAN algorithm; 11) Data cleaning, including: missing value processing and data legitimacy verification; Missing value processing: For missing values ​​in the urban management historical data, corresponding strategies are used to process them. If the latitude, longitude, and time fields are missing, the data is removed; if the event type field is missing, it is filled with a common event, and its weight is set to 1 in the subsequent weight setting; Data legitimacy verification: Verify whether the longitude and latitude of the event deviate from the current city. If so, it is considered abnormal data and cleared. 12) Set weights for different types of events and get the weight W of the nth type n ; 13) Use the DBSCAN algorithm to cluster the data: set the cluster radius ε and the density threshold MinPts, and use the DBSCAN algorithm to cluster to obtain d clusters and the event data set E on each cluster. d ; The specific steps are as follows: 131) Randomly select an unlabeled event p from the urban management event dataset E; 132) Traverse all data points except p, calculate the distance from each data point to p, if the distance is less than the clustering radius ε, the data point is in the domain of event p, if the distance is greater than the clustering radius ε, the data point is outside the domain of event p; determine whether the number of events within the clustering radius ε of event p is greater than the density threshold MinPts, if greater, then classify event p and the events within the clustering radius ε of its domain as cluster D1, and mark event p as a core object, otherwise mark it as a noise object; 133) Traverse the unmarked events in cluster D1 and perform the method of step 132) on them. If the number of events within the domain clustering radius ε is greater than the density threshold MinPts, then all related events are classified into cluster D1; until the number of events within the domain clustering radius ε of any event in cluster M1 is less than the density threshold MinPts, then the event data set E1 on cluster D1 is obtained; 134) Repeat steps 131) to 133), and finally all events are classified into a certain cluster or marked as noise objects; The events on a single cluster are grouped by hour to obtain the collection of events in each time period, as follows: AND d,t ={and i |and i ∈E d ,time(e i )=t} Among them, E d,t represents the set of events that occur in cluster d at time t, e i Indicates E d An event in time(e i ) represents event e i Time of occurrence; Combined with the weight W of the event type n , get the weighted total number of events N that occurred in a single hour d,t : N d,t =∑e i ∈E d,t ·weight(e i ) Among them, weight(e i ) represents event e i The weight of the event type.

3. The method for recommending urban management patrol locations based on random forest algorithm according to claim 1, characterized in that: The step 2) specifically includes: 21) Evaluate the importance of features, remove features that have little impact on the number of events, and use the Pearson correlation coefficient to evaluate the correlation between features and the number of events: Among them, x i and i are the number of urban management events in a day and the eigenvalues ​​corresponding to the required evaluation features, and They are the mean of the number of urban management events and the mean of the characteristic values ​​of the required evaluation features; The value range of γ is between -1 and 1, where 1 indicates a perfect positive correlation, -1 indicates a perfect negative correlation, and 0 indicates no correlation; When performing feature selection, list the features that affect the number of events, use the Pearson correlation coefficient to evaluate the correlation between the features and the number of events, and select features with high correlation for subsequent model construction; 22) When performing feature processing, the features are divided into numerical features, categorical features and time features, and different processing methods are adopted for different types of features; for numerical features, the original values ​​are used, specifically to make the features have different scales or variance differences; for categorical features, the feature values ​​are converted into a numerical form that can be used by the model using one-hot encoding, and each non-numerical feature is converted into a binary vector, in which only one element is 1, indicating the existence of the corresponding feature value, and the other elements are 0; for time features, the time is split into year, month, day, and hour, and four features are obtained after the split.

4. The method for recommending urban management patrol locations based on random forest algorithm according to claim 1, characterized in that: The step 3) specifically includes: The features obtained in step 2) are used as output to construct the feature vector X. The number of samples in the urban management dataset is set to m, and the number of features is set to n. The urban management dataset is represented by the matrix X m×n , where each row represents a sample and each column represents a feature, as follows: Define the weighted total number of events occurring per hour as the target variable Y, and the target variable vector is Y m×1 ; The constructed feature vector X and target variable Y are used to train the random forest model. The training process of the random forest is expressed by the following formula: Among them, Y pred represents the model's prediction of the target variable, N represents the number of decision trees, and f i (X) represents the prediction of the i-th decision tree.

5. The method for recommending urban management patrol locations based on random forest algorithm according to claim 1, characterized in that: The step 4) specifically includes: 41) The pre-processed urban management historical data is divided into multiple time windows in chronological order, each time window contains data of a certain length; in each time window, a part of the data is used for model training, and another part of the data is used to evaluate the performance of the model. This process is performed on the entire historical data by sliding the time window to simulate the performance of the model in different time periods; 42) For a single time window, the data is divided into a training set and a test set. After building a model with the training set, the root mean square error is used to evaluate the accuracy of a single model: Among them, RMSE is the root mean square error, y i represents the true target value, represents the predicted value of the model; After evaluating the models in all time windows, the mean square error (MSE) is used to obtain the final evaluation result: Among them, RMSE(i) represents the root mean square error of the model in the i-th time window; By evaluating the performance of the model in different time windows, the temporal stability and generalization of the model can be obtained; based on the evaluation results, the various parameters of the model are adjusted until the output results meet the requirements.

6. The method for recommending urban management patrol locations based on random forest algorithm according to claim 1, characterized in that: The step 5) specifically includes: A cyclic process of modeling, evaluating, and optimizing each cluster independently; After modeling, evaluating, and optimizing a single cluster, we obtain the event quantity prediction model for this cluster. The time to be predicted is input into the optimized model in step 4) to obtain the event quantity prediction N for the dth cluster at that time. d,t ; The 10 locations with the largest number of predicted events are recommended patrol locations.