Abstract
Dynamic Classifier Selection (DCS) techniques aim to select the most competent classifiers from an ensemble per test sample. For each test sample, only a subset of the most competent classifiers is used to estimate its target value. The performance of the DCS highly depends on how we define the local region of competence, which is a local region in the feature space around the test sample. In this paper, we propose a new definition of region of competence based on a new proximity measure. We exploit the observed similarities between traffic profiles at different links, days and hours to obtain similarities between different values. Furthermore, long-term traffic pattern prediction is a complex problem and most of the traffic prediction literature are based on time-series and regression approaches and their prediction time is limited to next few hours or days. We tackle the long-term traffic pattern prediction as a classification of discretized traffic indicators to improve the accuracy of urban traffic pattern forecasting of next weeks by using DCS. We also employ two different link clustering methods, for grouping traffic links. For each cluster, we train a dynamic classifier system for predicting the traffic variables (flow, speed and journey time). Our results on strategic road network data shows that the proposed method outperforms the existing ensemble and baseline models in long-term traffic prediction.
Keywords
Introduction
Long-term traffic prediction plays an important role in improving the quality of traffic management, alleviating road traffic congestion and making reasonable arrangements for police or other management resources [1]. Although there is a large number of works on traffic pattern prediction, the problem of long-term forecasting for the next weeks is still not well addressed. Existing traffic forecasting researches mainly focus on short-term traffic forecasting problem and their prediction time of high precision is limited to 5-15 minutes [2, 3]. Besides, these solutions have a poor stability and their accuracy for long-term prediction is low [2, 3]. Long-term forecasting researches [1, 4–11] mostly focus on prediction of next few hours and days.
Traffic forecasting can be tackled using different modelling perspectives [12]: the statistical time-series perspective, the supervised regression perspective, clustering pattern recognition perspectives, and supervised classification perspective [13, 14]. While most of traffic forecasting literature are based on the time-series and regression approaches, in this paper, we tackle the long-term traffic pattern prediction as a multi-class classification problem. We discretize the traffic variables namely, average journey time, average speed and traffic flow into three levels (low, medium, high). An obvious advantage of this approach is that discrete values are closer to knowledge level representation than continuous ones and are easier to handle and interpret.
The problem addressed in this paper is the prediction of three discretized traffic parameters (average journey time, average speed and traffic flow) for next weeks. Long-term traffic prediction is a challenging problem as traffic state is easily interfered by random factors such as accidents or emergency situations. Numerous existing models focus on traffic forecasting of a particular traffic link, but there is no model that predicts all the traffic links of a country simultaneously. In this paper, we propose an ensemble prediction model to handle the challenging task of long-term traffic pattern forecasting for all highways in England. Given a traffic link (a road section), a day in week (1 to 7) and a time in day (1 to 24), we propose a model for predicting the traffic state for the specified link and time. Ensemble methods are popular research directions in machine learning and pattern recognition and aim to combine decisions from a set of weak learning algorithms (base learners) so that the generalization ability of the built classification model can achieve better performance compared to the base learners [15]. Although, ensemble learning method is widely applied to different problem, few models of traffic forecasting are proposed. A key problem in ensemble learning is choosing the best classifier for each instance. We propose a Dynamic Classifier Selection (DCS) [16] approach toward predicting the traffic variables for the next several weeks. Our main contributions are as follows:
Motivation and contribution
An ensemble learning model is proposed for predicting traffic parameters. The method splits the traffic links into different groups. While many works, train a separate prediction model for each traffic link we cluster traffic links based on their traffic profile similarities and train a dynamic selection classifier system for each group of similar links. Most of traffic forecasting literature is based on the time-series and regression approaches. In this paper, we tackle the long-term traffic pattern prediction as a multi-class classification problem in which traffic variables (average journey time, average speed and traffic flow) are discretized into three levels (low, medium, high). An obvious advantage of this approach is that discrete values are closer to knowledge level representation than continuous ones and are easier to handle and interpret [17]. Besides, while most of the traffic prediction models predict the next few hours or days, the proposed classification approach help in predicting the next weeks. We propose a new definition of region of competence [16] based on a new custom-defined similarity measure. We exploit the observed similarities between traffic profiles at different links, days and hours to obtain similarities between different values. In the proposed proximity measure, the distance between two values v
i
and v
j
of a feature (link, day or hour) is determined with respect to how much having these different values results in difference in response values. We also introduce a new variant of the Oracle method [21], which we refer to as “OracleTr”, for computing the most competent classifier(s).
The rest of this paper is structured as follows. We review the related work in Section 2. In Section 3 DCS is described. In Section 4 DCS method. In Section 5, we give the evaluation and comparison results. Finally, Section 6 provides concluding remarks.
Related work
This section provides a brief overview of the earlier research contributions on traffic pattern forecasting.
Machine learning methods
Machine learning models identify traffic state with the construction of prediction models [23]. Different machine learning works try to predict different traffic variables including flow, volume, speed, density, or occupancy [24–26]. The traffic flow prediction problem aims at estimating the number of vehicles for a specific region and time interval. In [24], based on multivariate linear regression model, the authors proposed a traffic flow prediction method. In [25], a dynamic travel time prediction model is given based on Support Vector Machines (SVM). A vast amount of works use Neural Networks (NN) for traffic prediction. In [26] the authors give a survey of different types of NN structures applied for traffic prediction.
Some research convert the time series problem into a classification problem. The work [28] focuses on congestion level prediction based on classification of discretized time series. The work [29] discretizes the traffic load which represents the quality of travel. In [30], a regression to classification procedure is incorporated to construct a more accurate classification-type loss function out of the regression problem of traffic volume forecasting. The work [31] also uses regression to classification (R2C) for prediction of level of service.
Long term traffic pattern prediction
Some researches has been done on long-term traffic prediction [1, 4–9]. A novel traffic flow prediction framework has been proposed in [32]. The work [10] proposed a hybrid deep learning model based on wavelet decomposition, convolutional neural network-long and short-term memory neural network, for prediction of next-day traffic flow. [4] proposed a daily long-term traffic flow prediction based on deep neural networks. In [6], a long-term traffic situation forecasting model is proposed based on functional nonparametric regression. In [1], a method for long term travel time prediction using historical data is given. In [7], the authors proposed a framework for an online traffic prediction, which discovers the contextual specialization of predictors to create a strong hybrid predictor from several weak predictors. The work [8] proposed a long-term estimation method based on the automated discovery of patterns. The method proposed in [9] analyzes how to properly characterize traffic flow in urban road scenarios. They use a clustering phase to discover typical ties or patterns within the traffic flow data. In [2, 3], the authors propose a traffic flow prediction algorithm with higher accuracy and longer prediction time. They propose an unequal interval combining model based on improved LSTM and ARIMA, which can guarantee a higher rate of accuracy.
Ensemble learning methods in traffic prediction
Ensemble learning is a promising research direction in machine learning [15]. Ensemble learning methods are widely applied to different problems. There are some ensemble learning works in the area of traffic prediction [7, 34]. Ensemble and dynamic classifier ensemble methods are alternative ways for improving the performance. In [34], the authors proposed a hybrid approach which combines NN and a simple statistical approach. The authors of [7] proposed a novel online framework that could learn from the current traffic state in real-time and predict the future traffic. In [22], the authors proposed a heterogeneous ensemble method with dynamic selection. Few works on classification over discretized traffic data. The work [33] proposed a stacked ensemble learning method using empirical mode decomposition. In [35, 36], the authors use gradient boosting regression tree method (GBM) to analyze and model travel time.
Computing the competence level
Several methods are commonly used for computing the competence level of base classifiers [16, 18]:

The three phases of a dynamic classifier selection system.
An alternative to using a single highly optimized classifier for a classification problem is to use Dynamic Classifier Selection (DCS) through an appropriate selection method. If the base classifiers make complementary decisions, appropriate selection of them will improve the classification accuracy with respect to that of individual classifiers [16]. A DCS system is composed of three stages [16]: (1) Generation, (2) Selection, and (3) Aggregation (Fig. 1). In the generation stage, a pool of classifiers {C1, …, C M } is trained to create a set of diverse “base” classifiers. In the selection stage, once a query sample x j is given, the competence of each C i for classifying x j is estimated based on, θ j , the local region in the validation data where x j is located. The idea is that each base classifier in the pool has a different domain of expertise. This local region can be defined by different region of competence definitions [16], such as applying the k-NN method, to find the neighborhood of x j . The definition of region of competence is of fundamental importance in achieving an acceptable performance. The standard definition is based on the k-NN method with the Euclidean distance measure which is not effective in many situations. In selection stage, the most competent classifier or a subset of the most competent classifiers is selected for classifying x j . Employing an appropriate method for estimating the competence level, δi,j, of classifier C i for classifying x j is of key importance. Finally, in integration phase, the decisions of the selected classifiers are aggregated to obtain the decision. For more information about DCS models, the reader can refer to [16], where the authors categorize the main dynamic selection techniques and also conduct an extensive experimental analysis, considering a total of 18 state-of-the-art dynamic selection techniques.
Proposed model
Preprocessing
We propose a DCS system for predicting the traffic state variables of the Strategic Road Network (SRN) dataset [37], which provides average journey time, average speed and average traffic flow information for about 2500 links around the Highways England that maintain and improve the motorways and major “A roads” in England. The description of the SRN is given in Table 1A. detailed description of the features of this data can be found in Highways England website1.
Traffic variables have a periodic pattern. Figure 2(a) shows the average speed of 10 random links in 12 consecutive month of 2014. Also, at the top of Fig. 2(b) the daily average speed of a random link, and at the bottom, the daily average speed of all links is shown in March 2014.

(a) average speed of 10 randomly selected links in 12 consecutive month of 2014, (b-top) daily average speed of a random link in march 2014, (b-bottom) daily average speed in all links in march 2014, (c) changes in the average speed in a random day in different time scales from one quarter (top) to two hours (bottom).
Where μ and σ are respectively mean and standard deviation of the field for the corresponding traffic link. After discretizing the “AverageJT”, “AverageSpeed” and “Flow” fields, discretized fields are named das, dajt, and dflow respectively. We discretize different traffic variables and tackle the traffic prediction problem as a multi-class classification problem.
Description of the Strategic Road Network (SRN) dataset and the preprocessed features
Given a query sample x j = (l, w, h), where l is a traffic link, w is a day in week (1 to 7), and h is a time in day (1 to 24), we propose a dynamic classifier system model to predict the discrete traffic indicators for the specified link and time. Figure 3 shows the architecture of the proposed model. In the proposed dynamic classifier selection system, we cluster the traffic links into p partitions P1, P2, …, P p based on their traffic profile similarities. We examine two different methods for computing the similarity of links. We denote by T r and D r the parts of training and dynamic selection (validation) datasets, respectively, corresponding to partition P r , r = 1, …, p. For each cluster P r , we build a separate dynamic classifier selection system. For this, we train a pool of classifiers according to the training dataset T r . Once a query sample x j from a link in P r is given, the region of competence for x j is computed in the dynamic selection dataset D r , according to the proposed definition described in subsection4.2.2. In order to estimate the competence level of base classifiers for classifying x j , we use the method described in section4.2.3. Finally, we choose the most competent classifier(s) for classifying x j .

The architecture of the proposed model.
We partition traffic links into 40 clusters (based on the evaluation results of subsection5.1(Fig 5)) and for each cluster we train a DCS system with an inhomogeneous pool of classifiers. Our pool of classifiers consists of SVM with One-vs-One strategy, k-NN with k = 4, Scaled Conjugate Gradient (SCG) NN, Levenberg-Marquardt (LM) NN and Bayesian Regularization (BR) NN models. NN models are initialized with random weight values, and their hidden layer has different number of nodes for different classifiers. We train 20 classifiers (according to evaluation results performed for different number of the classifiers) for each of theNN models.
Definition of region of competence
The definition of region of competence is of fundamental importance in achieving an acceptable performance. Beside the standard k-NN method with the Euclidean distance [19–21], the CART method [22], is another method for computing the region of competence that uses the well-known CART algorithm. After obtaining a tree with the CART algorithm on the training data, they apply the tree on the test query. The selected data are all the examples from the leaf node where the test example falls. An important limitation of this method is that there is no upper bound on the number of similar examples. In this work, we propose two region of competence computation methods:
1) Clustering-based techniques [39, 40], in which the region of competence of a query sample is the set of points in its cluster. In this technique, training samples are clustered and the competence of each base classi?er is estimated for each cluster. During the generalization stage, given a query, x j , the distance between x j and the centroid of each cluster is obtained and the competence of each base classifier C i for x j will be the competence of C i for classifying the samples in the nearest cluster. In order to apply this method for traffic prediction we cluster traffic links.

Schematic diagram of the proposed method for computing the similarity of two triples x i = (l′, w′, h′) and x j = (l, w, h).
2) k most similar neighbors technique in which the region of competence of a query sample is defined as the set of k most similar points in the dynamic selection dataset. However, since the Euclidean distance measure is not efficient for this situation, we propose a new custom-defined similarity measure (subsection 4.2.4).
In order to estimate the competence level of base classifiers we modify the oracle model. In our modified variant, which we refer to as OracleTr, we use a threshold value, θ c = ⌊ k/3 ⌋ +1 and select classifiers that correctly classify at least θ c samples in the region of competence, where k is the size of region of competence. If no classifier can satisfy this condition, we chose the classifier(s) with the best performance.
Traffic pattern similarity measure
The distance measure adopted for calculating the distance among samples, is another issue, which has been shown to be crucial for improving the performance of k-NN methods. In order to compute the proximity of samples, some researches propose to use a custom-defined similarity measure which is based on statistical test theory. In this work, we exploit the observed similarities between traffic profiles at different links, days and hours to obtain similarities between different values. In order to estimate the region of competence of a query sample x j = (l, w, h), where l is a traffic link, w is a day in week, and h is a time in day, we need to give an appropriate definition for similarity. There are several notions of proximity which are commonly used for finding the nearest neighbors including Euclidean and cityblock and etc.
We propose a custom-defined similarity measure for estimating the similarity between two tuples x j = (l, w, h) and x i = (l′, w′, h′). In the proposed similarity measure, the distance between two values v and v′ of a feature is determined with respect to how having these different values results in difference in response values. Figure 0ref figSMC shows the schematic diagram of the proposed similarity measure. First, the similarity between links, days in week and hours in day is computed with respect to the similarity of traffic pattern in those links, weekdays and hours. Then, the similarity of x i and x j , is obtained by combining the similarity of links l and l′, the similarity of weekdays w and w′, and the similarity of hours h and h′, with equal weights.
We examine two different clustering methods for partitioning traffic links into groups according to their characteristics:
Also, for each of the above methods we examine two variants: one considering location and length of links and one omitting these fields. Our results demonstrated that considering these fields has no positive effect on classification results. The optimal number of clusters is determined manually with respect to the classification accuracy. Subsequently, for each cluster we obtain a separate DCS.

The impact of the number of clusters on the prediction accuracy for different discretization and clustering methods.
In this section, we evaluate the performance of the proposed DCS model. We use the monthly SRN data for evaluation of the proposed method. We use the data of February to April of 2014 for training and data of May 2014 for evaluating the proposed method. We compare five alternatives:
We assess the impact of different parameters, namely the number of weeks of validation data, the forecasting horizon, and the size of the region of competence. We also find the optimal number of clusters. We use the accuracy and F-measure for evaluating the performance. The accuracy is defined as the number of items classified correctly divided by the number of all items classified and F-measure is the harmonic mean of precision and recall.
Finding the optimal number of clusters
An important problem is determining the optimal number of clusters. Figure 5 shows the impact of the number of clusters (1-100) on the performance for different discretization and clustering methods for average journey time (a), average speed (b) and flow (c). The result on 500 randomly selected links shows that increasing the number of clusters beyond 40 increases the processing time with almost no gain. Therefore, the number of clusters, in the rest of this paper is assumed to be 40. We also assessed the impact of the number of clusters on the prediction accuracy for different distance measures. The results, omitted due to lack of space, showed that the correlation distance measure outperforms the other measures.
Number of weeks of validation data
Validation data is the data that is used to validate a machine learning model. In order to assess the impact of the size of validation (dynamic selection) dataset, we changed the number of weeks of this data from one to ten weeks (7 to 70 days). Parts (a), (b) and (c) of Fig. 6 respectively show the impact of the number of weeks of validation data on prediction accuracy for average journey time, average speed and flow. The result shows that as the number of validation weeks increases, so does the prediction accuracy of all methods. The result also shows that clustering the traffic links based on the proposed similarity measure has a significant impact on achieving higher levels of prediction accuracy. Also, using the proposed similarity measure and the proposed definition of region of competence leads to a significant improvement in the prediction accuracy of all traffic variables.

The impact of the number of weeks of validation (dynamic selection) data on the prediction accuracy.
Multistep-ahead prediction is to use the predicted value of the current time to determine its value in the next time steps. In order to study the multi-step ahead prediction in the proposed model, we assess the impact of forecasting horizon on prediction performance. The performance of the proposed model is compared against some non-ensemble models including SVM, kNN, Scaled Conjugate Gradient (SCG) NN, Levenberg-Marquardt (LM) NN and Bayesian Regularization (BR) NN model. The result of the comparison, in Fig. 7, shows that as the forecasting horizon increases the prediction accuracy decreases. The result also shows that the proposed model achieves a significant improvement over the non-ensemble methods.

The impact of the forecasting horizon on the prediction accuracy of the proposed DCS and base classifiers.

Performance comparison of the proposed and previous methods for predicting.
Considering an appropriate size for the region of competence, which is the local region surrounding the test query, strongly impacts our estimation of the competence level of base classifiers [16]. In this section, we compare the performance of the previous and proposed models for predicting the average journey time (a), average speed (b) and flow (c) for different sizes of the region of competence. The result in Fig. 8 shows that using the proposed link clustering methods has a positive impact on achieving better performance. Using the proposed similarity measure improves the F-measure significantly. Both the link clustering method and the custom-defined similarity measure help in achieving a more accurate region of competence and a higher F-measure. The result in Fig. 8 also helps in determining the optimal size for the region of competence. Increasing the size of the region of competence improves the performance for all traffic variables. However, increasing the size beyond eight seems to have almost no positive effect on improving theperformance.
The impact of the proposed similarity measure
In this section, we evaluate and compare the performance of the proposed region of competence computation method, which is based on a newly proposed similarity measure, against the k-NN-based and CART [22] methods. We consider different days in week and different traffic variables. The results of the prediction experiments based on the modified classifier ranking algorithm for 7 days is shown in Table 2. The result shows that the proposed region of competence computation method generally achieves better prediction performance in terms of accuracy.
Performance comparision of k-NN, CART and the proposed region of competence computation method
Performance comparision of k-NN, CART and the proposed region of competence computation method
The performance of the dynamic selection highly depends on how we define the local region of competence [16]. The standard method for this is using the k-NN with the Euclidean distance [19–21]. One limitation of these methods is that they weight all input variables (link, day, weekday, time period) equally, even if there are input variables with different levels of relevance in the explanation of the target variable. Another problem is that the Euclidean measure is not compatible with modular nature of time features like weekdays, day hours and etc. The CART method [22], as another method for computing the region of competence has the limitation that we have has no upper bound on the number of samples in the region of competence. Our results show that the proposed custom-defined similarity measure is effective in computation of the region of competence and helps in achieving higher accuracies.
In order to analyse the robustness of the proposed model, we verify its robustness by performing “what if analysis" experiments on the SRN dataset; we assess the impact of different links for 21 days of test data. Experiments are repeated several times to reach more accurate results. We compare the performance of the proposed and previous methods for next-weeks prediction. The proposed method is compared against the baseline models including KNN and Levenberg-Marquardt Neural Network (LM), the modified classifier ranking method (Rank) [19], the ensemble learning model (CART) and the long term traffic prediction method based on deep learning [4] (DL) which considers the contextual factors. Table 3 gives this comparison results in terms of accuracy (A) and F-measure (F) for five randomly selected traffic links. Please note that, the best performer in each row is underlined. The result show that the proposed method outperforms the previous methods significantly.
Comparision of the proposed and previous methods for next week prediction in terms of accuracy (A) and F-measure (F)
Comparision of the proposed and previous methods for next week prediction in terms of accuracy (A) and F-measure (F)
We used ensemble learning method that integrate weak learner to increase accuracy, the performance of the ensemble learning highly depends on definition of the local region of competence and we define the similarity measure. Beside, we used clustering method to grouping traffic links that increased the accuracy. The result shows that clustering the traffic links based on the proposed similarity measure has a significant impact on achieving higher levels of prediction accuracy. Also, results show that using the proposed similarity measure and the proposed definition of region of competence leads to a significant improvement in the prediction accuracy of all traffic variables.
In this paper, we proposed an ensemble learning method for long-term traffic pattern forecasting. First, we propose a DCS approach. As the performance of DCS highly depends on how we define the local region of competence, we propose a new custom-defined similarity measure for computing the similarity of traffic links, weekdays and day hours, based on which a new definition of region of competence is proposed. Second, we employ two different link clustering methods. For each cluster, we train a DCS for predicting average journey time, average speed and traffic flow. Third, we propose a new variant of the oracle method for competence level computation. Since discrete values are closer to knowledge level representation than continuous ones and are easier to handle, we tackles the long-term traffic pattern forecasting as a classification problem for discretized traffic variables rather than a time-series problem.
The main reason for the performance improvement of the proposed prediction model is that we employ ensemble learning using the proposed DCS method, which considers the observed similarities between traffic profiles at different links, days and hours to obtain similarities between different values.
The robustness of our model was verified by experiments on SRN dataset from multiple angles, different links and different days. Since the traffic parameters are affected by some contextual factors and spatio-temporal data, in the future we plan to create and add meta-features to our model to achieve more accurate results.
