## 2 Short-Term Traffic Flow Prediction Model Construction
### Modeling of Urban Associated Roads
#### 2.1.1 Road Association Rule Analysis
Calculate the confidence level  
In Apriori algorithm, confidence is used to assess the reliability of association rules. According to the constructed association rule \(X\Rightarrow Y\), the confidence measures the probability that, when \(X\) occurs, \(Y\) will also occur. Specifically, it can be expressed as \(confidence(X\cup Y)=\frac{Support(X\cup Y)}{Support(X)}\). Typically, the minimum confidence threshold required for modeling is found based on the mining of the correlation between urban road flows, denoted as minconf, and an association rule is considered significant only if its confidence exceeds this threshold. According to the minimum confidence threshold and support threshold set when constructing the model, the goal of finding the road association rules is to discover the strong association rules for roads with support, confidence greater than or equal to the given minimum threshold from the urban road traffic database. Generate frequent item sets and produce strong association rules  
By analyzing the frequent item sets between urban roads, the corresponding association rules can be constructed. Firstly, the largest frequent item set is determined, then all non-empty subsets are filtered from it, and these rules are calculated to determine their confidence level, and finally, a series of strong association rules are derived. Urban Road Linkage Model Results  
To guarantee the optimal effect of urban road correlation results, after many parameter adjustments and related literature research, this paper finally selects the correlation results with 80% support and 90% confidence as the final results of urban road correlation, and the correlation results under different parameters are shown in Table 2: \begin{table}
\begin{tabular}{c c c} \hline
**Degree of Support** & **Confidence Level** & **Average Number of Associated Roads** \\ \hline
90\% & 95\% & 2.6 \\
90\% & 90\% & 3.2 \\
85\% & 95\% & 3.7 \\
85\% & 90\% & 4.1 \\
80\% & 95\% & 4.3 \\
80\% & 90\% & 7.4 \\
75\% & 95\% & 10.9 \\
75\% & 90\% & 11.4 \\
70\% & 95\% & 17.3 \\
70\% & 90\% & 22.1 \\ \hline \end{tabular}
\end{table} 
Table 2: Apriori correlation result table of each parameter. Explanation of Support and Confidence in Road Association Rules:  
(1) Support:  
In the context of urban road association rules, support measures the frequency with which a particular combination of roads appears together in the dataset. For example, if a set of roads {Road A, Road B} has a support of 80%, it means that 80% of the transactions (or instances) in the dataset include both Road A and Road B. This indicates a strong correlation between these roads, suggesting that traffic conditions on Road A are likely to affect or be affected by traffic conditions on Road B. A higher support value indicates a more frequent co-occurrence of the roads in the dataset, which is crucial for identifying significant associations in traffic flow patterns. (2) Confidence:  
Confidence measures the reliability of the association rule. For example, if the association rule [Road A] \(\rightarrow\) [Road B] has a confidence of 90%, it means that 90% of the instances where Road A is present, Road B is also present. This indicates a strong directional relationship between Road A and Road B. A higher confidence value indicates a stronger relationship between the roads, suggesting that traffic conditions on Road A are highly predictive of traffic conditions on Road B. This is particularly useful for predictive modeling and traffic management strategies. The table shows the average number of roads associated with different levels of support and confidence levels. As the level of support decreases, the number of associated roads gradually increases, suggesting that propositions with a lower level of support may involve a wider range of roads, while at the same level of support, the higher the confidence level, the fewer the number of associated roads, suggesting that the high confidence scenario is more concentrated in terms of the roads affected.