Multiple Na \ ve Bayes Classifiers Ensemble for Traffic Incident Detection

This study presents the applicability of the Näıve Bayes classifier ensemble for traffic incident detection. The standard Naive Bayes (NB) has been applied to traffic incident detection and has achieved good results. However, the detection result of the practically implementedNBdepends on the choice of the optimal threshold, which is determinedmathematically by using Bayesian concepts in the incident-detection process. To avoid the burden of choosing the optimal threshold and tuning the parameters and, furthermore, to improve the limited classification performance of the NB and to enhance the detection performance, we propose an NB classifier ensemble for incident detection. In addition, we also propose to combine the Naı̈ve Bayes and decision tree (NBTree) to detect incidents. In this paper, we discuss extensive experiments that were performed to evaluate the performances of three algorithms: standard NB, NB ensemble, and NBTree. The experimental results indicate that the performances of five rules of the NB classifier ensemble are significantly better than those of standard NB and slightly better than those of NBTree in terms of some indicators. More importantly, the performances of the NB classifier ensemble are very stable.


Introduction
The functionality of automatically detecting incidents on freeways is a primary objective of advanced traffic management systems (ATMS), an integral component of the Nation's Intelligent Transportation Systems (ITS) [1].Traffic incidents are defined as nonrecurring events such as accidents, disabled vehicles, spilled loads, temporary maintenance and construction activities, signal and detector malfunctions, and other special and unusual events that disrupt the normal flow of traffic and cause motorist delay [2,3].If the incident cannot be handled timely, it will increase traffic delay, reduce road capacity, and often cause second traffic accidents.Timely detection of incidents is critical to the successful implementation of an incident management system on freeways [4].
Incident detection is essentially a pattern classification problem, where the incident and nonincident traffic patterns are to be recognized or classified [5].That is to say, incident detection can be viewed as a pattern recognition problem that classifies traffic patterns into one of the two classes: nonincident and incident classes.The classification is normally based on spatial and temporal traffic pattern changes during an incident.The spatial pattern changes refer to the traffic pattern alterations over a stretch of a freeway.The temporal traffic pattern changes refer to the traffic pattern alterations over consecutive time intervals.Typically, traffic flow maintains a consistent pattern at upstream and downstream detector stations.When an incident occurs, however, traffic flow at the upstream of incident scene tends to be congested while that at the downstream station tends to be light due to the blockage at incident site.These changes in the traffic flow are reflected in the detector data obtained from both the upstream and downstream stations [5].Therefore, an AID problem is essentially a classification problem.Any good classifier is a potential tool for the incident detection problem.Based on this idea, in our approach to incident detection in general, we treat the problem as one of pattern classification problems.Under normal traffic operation, traffic parameters (speeds, occupancies, and volumes) both upstream and downstream from a given freeway site are expected to have more or less similar patterns in time (except under bottleneck situations).In the case of an incident, this normal pattern is disrupted.Patterns of incident develop increased occupancies and drop in speeds for instance.
Automated incident detection (AID) systems, which employ an incident detection algorithm to detect incidents from traffic data, aim to improve the accuracy and efficiency of incident detection over a large traffic network.Early AID algorithm development focused on simple comparison methods using raw traffic data [6,7].To enhance algorithm performance and to achieve real-time incident detection, advanced methods have been suggested, which include image processing [8], artificial neural networks [9], support vector machine [4], and data fusion [10].Although these new published methods represent significant improvements, performance stability and transferability are still major issues concerning the existing AID algorithms.To enhance freeway incident detection and to fulfill the universality expectations for AID algorithms, the classic Bayesian theory has attracted many scientists' attention.Due to the Naïve Bayes ensemble and Naïve Bayes, and decision tree (NBTree) algorithm simplicity and easy interpretation, the applications of this approach can be found in an abundant literature.However, the report of its application to traffic engineering is rare.It provides ample motivation to investigate this model performance on incident detection.
There are drawbacks which limit its applications; the optimal threshold and parameter of Naïve Bayes (NB) have a great effect on the generalization performance, and setting the parameters of the NB classifier is a challenging task.At present, there is no structured method to choose them.Typically, the optimal threshold and parameters have to been chosen and tuned by trial and error.Some studies have applied search techniques for this problem; however, a large amount of computation time will still be involved in such search techniques, which are themselves computationally demanding.
A natural and reasonable question is whether we can increase or at least maintain NB performance, while, at the same time, avoiding the burden of choosing the optimal threshold and tuning the parameters.Some researchers have proposed classifier ensembles to address this problem.The performance of classifier ensemble has been investigated experimentally, and it appears to consistently give better results [11][12][13].Kittler et al. [12] used different combining schemes based on multiple classifier ensembles, and six rules were introduced into ensemble learning to search for accurate and diverse classifiers to construct a good ensemble.The presented method works on a higher level and is more direct than other search based methods of ensemble learning.The previous research illustrated that ensemble techniques are able to increase the classification accuracy by combining their individual outputs [14,15].While these general methods are preexisting, their application into the specific problem and their integration into the proposed model for the detection of traffic incident are new.It is expected that the NB classifier ensemble has more generalization ability, but the method has not been seen discussed in the context of incident detection.Coupling this expectation of reasonably accurate detection with the attractive implementation characteristics of the NB classifier ensemble, we propose to apply the NB classifier ensemble achieved by the combination of different rules to detect incidents.The NB classifier ensemble algorithm trains many individual NB classifiers to construct the classifier ensemble and then uses this classifier ensemble to detect the traffic incidents.It needs to train many times.Taking this into account, we also propose NBTree [16] for incident detection.The NBTree splits the dataset by applying an entropy-based algorithm and uses standard NB classifiers at the leaf node to handle attributes.The NBTree applies strategy to construct a decision tree and replaces leaf nodes with NB classifiers.We have performed some experiments to evaluate the performances of the standard NB, NB ensemble, and NBTree algorithms.The experimental results indicate that the performances of five rules of the NB classifier ensemble are significantly better than those of standard NB and slightly better than those of NBTree in terms of some indicators.More importantly, the performances of the NB classifier ensemble are very stable.
The remaining part of the paper is structured as follows.Section 2 introduces the combination schemes of the NB classifier ensemble.The general performance criteria of AID are presented in Section 3. Section 4 is devoted to empirical results.In this section, we evaluate the performances of the three algorithms: standard NB, NB ensemble, and NBTree.Finally, the conclusions are drawn in Section 5.

Classification and Classifier.
A dataset generally consists of feature vectors, where each feature vector is a description of an object by using a set of features.For example, take a look at the synthetic dataset as shown in Figure 1.Here, each object is a data point described by the features -coordinate, -coordinate, and color, and a feature vector looks like (0.8, 0.9, yellow) or (0.9, 0.1, red).Features are also called attributes, a feature vector is also called an instance, and sometimes a dataset is called a sample.Naïve Bayes classifier ensemble is a predictive model that we want to construct or discover from the dataset.The process of generating models from data is called learning or training, which is accomplished by a learning algorithm.In supervised learning, the goal is to predict the value of a target feature on unseen instances, and the learned model is also called a predictor.For example, if we want to predict the color of the synthetic data points, we call "yellow" and "red" labels, and the predictor should be able to predict the label of an instance for which the label information is unknown, for example, (0.7, 0.7).If the label is categorical, such as color, the task is called classification and the learner is also called classifier.

Naïve Bayes Classifier.
To classify a test instance , one approach is to formulate a probabilistic model to estimate the posterior probability ( | ) of different 's and predict  the one with the largest posterior probability; this is the maximum a posteriori (MAP) rule.By Bayes Theorem, we have where As demonstrated in paper [17], for a threshold level of 0.0006, 65.4% of incidents were identified.However, if the threshold cannot be chosen appropriately, fewer incidents will be identified correctly.As known from machine learning, the naive Bayesian classifier provides a simple approach, with clear semantics, for representing, using, and learning probabilistic knowledge.The method is designed for use in supervised induction tasks, in which the performance goal is to accurately predict the class of test instances and in which the training instances include class information.In this way, it avoids choosing the optimal threshold and tuning the parameters manually.

Combining Schemes
2.3.1.Five Rules.The most widely used probability combination rules [12] are the product rule, the sum rule, the min rule, and the max rule.Given  classifiers and  1 , . . .,   , classes  1 , . . .,   , these are defined as follows.
Product rule: where x  is the input to the 'th classifier and (  ) is the a priori probability for class   .Sum rule: Min rule: Max rule: Majority vote rule: Note that for each class   , the sum on the right hand side of (8) simply counts the votes received for this hypothesis from the individual classifiers.The class that receives the largest number of votes is then selected as the majority decision.
Mathematical Problems in Engineering

Combine Decision Tree and Naïve
Bayes.The Naïve Bayesian tree (NBTree) algorithm is similar to the classical recursive partitioning schemes, except that the leaf nodes created are naïve Bayesian classifiers instead of nodes predicting a single class [16].First, define a measure called entropy that characterizes the purity of an arbitrary collection of instances.Given a collection , if the target attribute can take on  different values, then the entropy of  relative to this -wise classification is defined as where   is the proportion of  belonging to class .The information gain, Gain(, ), of an attribute , the expected reduction in entropy caused by partitioning the examples according to this attribute relative to , is defined as where value () is the set of all possible values for attributes  and  V is the subset of  for which attribute  has value V. NBTree is a hybrid approach that attempts to utilize the advantage of both decision trees and naïve Bayesian classifiers.It splits the dataset by applying an entropy-based algorithm and uses standard naïve Bayesian classifiers at the leaf node to handle attributes.NBTree applies strategy to construct a decision tree and replaces leaf nodes with NB classifiers.

Performance Criteria of Aid
3.1.Definition of DR, FAR, MTTD, and CR.Four primary measures of performance, namely, detection rate (DR), false alarm rate (FAR), mean time to detection (MTTD), and classification rate (CR), are used to evaluate traffic incident detection algorithms.We will quote the definitions from [18,19].DR is defined as the number of incidents correctly detected by the traffic incident detection algorithm divided by the total number of incidents known to have occurred during the observation period: FAR is defined as the proportion of instances that were incorrectly classified as incident instances based on the total instances in the testing set.Out of the total number of applications of the model to the dataset, FAR is calculated to determine how many incident alarms were falsely set.
In order to decrease FAR, persistent test is often used.An incident alarm is triggered whenever  consecutive outputs of the model exceed the threshold, which is called persistent check of  FAR = number of false alarm cases total number of non-incident cases × 100%. ( MTTD is computed as the average length of time between the start of the incident and the time the alarm is initiated.When multiple alarms are declared for a single incident, only the first correct alarm is used for computing the detection rate and the mean time to detect Besides these three measures, we also use classification rate (CR) as an index to test traffic incident detection algorithms.Of the total number of applications of cycle length data or input instances, the percentage of correctly classified instances (including both incident and nonincident instances) by the model is computed as CR CR = number of instances correctly classified total number of instances × 100%. (14)

Area under the ROC Curve (AUC).
Receiver operator characteristic (ROC) curves illustrate the relationship between the DR and the FAR from 0 to 1. Often the comparison of two or more ROC curves consists of either looking at the area under the ROC curve (AUC) or focusing on a particular part of the curves and identifying which curve dominates the other in order to select the best-performing algorithm.AUC, when using normalized units, is equal to the probability that a classifier will rank a randomly chosen positive instance higher than a randomly chosen negative one (assuming "positive" ranks higher than "negative") [20].It can be shown that the area under the ROC curve is closely related to the Mann-Whitney , which tests whether positives are ranked higher than negatives.It is also equivalent to the Wilcoxon test of ranks [21].The AUC is related to the Gini coefficient ( 1 ) by the formula [22].In this way, it is possible to calculate the AUC by using an average of a number of trapezoidal approximations: where

Statistics Indicators.
In statistics, the mean absolute error (MAE) is a quantity used to measure how close forecasts or predictions are to the eventual outcomes.The mean absolute error is given by The root-mean-square error (RMSE) is a frequently used measure of the differences between values predicted by a model or an estimator and the values actually observed.These individual differences are called residuals when the calculations are performed over the data sample that was used for estimation and are called prediction errors when computed out of sample.The RMSE serves to aggregate the magnitudes of the errors in predictions for various times into a single measure of predictive power: The equality coefficient (EC) is useful for comparing different forecast methods; for example, whether a fancy forecast is in fact any better than a naïve forecast repeating the last observed value.The closer the value of EC is to 1, the better the forecast method.A value of zero means the forecast is no better than a naïve guess: Kappa measures the agreement between two raters who each classify  items into  mutually exclusive categories.Kappa is computed as formula (19), () is the observed agreement among the raters, and () is the expected agreement; that is, () represents the probability that the raters agree by chance.The values of Kappa are constrained to the interval [−1, 1].Kappa = 1 means perfect agreement, Kappa = 0 means that agreement is equal to chance, and Kappa = −1 means "perfect" disagreement:

Parameters and Procedures of Experiments.
To describe the experiments clearly, we first present the definitions for all parameters and symbols used in experiments.Then, we describe the experiment procedures in detail.
4.1.1.Parameters of Experiments.Some parameters are adopted to make the procedures of the experiments more automatic and optimized.In addition, some symbols are used to denote specified conceptions.For clarity, we have presented the definitions of each parameter and symbol in Table 1.

Construction of Datasets for Training and Testing.
The traffic data mentioned refers to three basic traffic flow parameters, namely, volume, speed, and occupancy.The incident is detected based on section, which means that the traffic data collected from the upstream and the downstream detection stations are usually used as model inputs in AID systems.In Figure 2 (3) use the all the  existing individual NB classifiers to construct the th ensemble NB classifier ENBC  .

Parameter Setting of Experiments for I-880 Dataset.
To divide   into  sub properly, there are some parameters that need to be set, which can be seen in Table 2.We set values for each parameter and present the results in Table 2.
In our experiments, we constructed 20 individual NB classifiers, 20 NB ensemble classifiers, and 20 NBTree classifiers.We tested the performances of the five rules of each classifier on the I-880 dataset.Then, we calculated the averages and variances of the performances of the 20 individual NB classifiers, 20 NB ensemble classifiers, and 20 NBTree classifiers.The summarized results are in Table 3.In Table 3, the results are presented with the form average ± variance, and the best results are highlighted in bold.To make a visual comparison of the performances of all classifiers, we plotted them in Figures 4 and 5.

Data Description for AYE Dataset.
The traffic data used in this study for the development of the incident detection models was produced from a simulated traffic system.A 5.8 km section of the Ayer Rajah Expressway (AYE) in Singapore was selected to simulate incident and nonincident conditions.This site was selected for incident detection study because of its diverse geometric configurations that can cover a variety of incident patterns [23,24].The simulation system generated volume, occupancy, and speed data at upstream and downstream sites for both incident and nonincident traffic conditions.The traffic dataset consisted of 300 incident cases that had been simulated based on AYE traffic.The simulation of each incident case consisted of three parts.The first part was the nonincident period that lasted for 5 min.This was after a simulation of a 5 min warm-up time.During the warm-up time, the data contains noise.The second part was the 10 min incident period.This was followed by a 30 min postincident period.Each input pattern included traffic volume, speed, and lane occupancy accumulated at 30 s intervals, averaged across all the lanes, as well as the traffic state.The value of the traffic state label is −1 or 1, referring to nonincident or incident states, respectively.

Parameter Setting of Experiments for the AYE Dataset.
As we used a new dataset to perform the experiments, the parameter values of the experiments needed to be updated.The updated parameter values can be seen in Table 2.

Experimental Results with the AYE Dataset.
As mentioned in Section 4.3.1, the AYE dataset includes noisy data, which seriously reduces the quality of the detection.Therefore, the experimental results obtained with the AYE dataset are much worse than the experimental results from the I-880 dataset overall.The AYE dataset experimental results are summarized in Figures 6 and 7 and Table 4.In Table 4, for each algorithm of standard NB, NB ensemble, and NBTree, we calculate the averages and variances of the performances of the total 20 individual classifiers or ensemble classifiers.The results are presented as average ± variance, and the best results are highlighted in bold.

Performance Evaluation.
In this subsection, we have evaluated the performances of all three algorithms, standard NB, NB ensemble, and NBTree, using the I-880 dataset and the AYE dataset with noisy data.In Figures 4 and 6, the subfigures (a)∼(f) evaluate the performances of five rules on the indicators DR, FAR, MTTD, CR, AUC, and Kappa.In Figures 5 and 7, the subfigures evaluate the performances of MAE, RMSE, and EC.

Performance Evaluation for the I-880 Dataset.
From Figures 4 and 5, we can see that the performances of the sum rule, the max rule, and the min rule are stable and significantly better than the performances of the product rule and the majority vote rule.The performances of the product rule and the majority vote rule fluctuate violently dynamically, which demonstrates that the performances are unstable.The reason for this is that the results of the Naïve Bayes algorithm depend on the appropriate threshold and parameters, and the algorithm is not resilient to estimation errors.For example, in Figure 4(a), the DR of the product rule and the majority vote rule reaches 88% and 82% or even higher.In contrast, DR can also reach as low as 78% or even lower.In Figure 5 concerning the product rule, when the number of classifiers is less than 10, the RMSE reaches as low as 0.17 or even lower.In contrast, the RMSE can reach 0.19 or even higher.These results indicate that when the threshold and parameters are chosen appropriately, the detection performance can improve.We need to select an appropriate threshold and parameters to make the NB ensemble achieve optimal performances, But the procedures for choosing an appropriate threshold and parameters need to use the trial and error method.Until now, there has not been a structured way to choose these values.There is another significant phenomenon that can be found from the data in Figures 4 and 5.When the number of classifiers increases, the performance of the five rules mitigates their fluctuation, and they tend to achieve a stable value.The reason for this is that the multiple classifiers ensemble can compensate for the defect of a single classifier to some extent.From Figure 4, we can also see that the performances of the sum rule, the max rule, and the min rule on each indicator are very close to each other.As for the indicators DR, FAR, AUC, and Kappa, the performance of the sum rule is slightly better than that of the max rule and the min rule.As mentioned above, AUC and Kappa can evaluate the performances more comprehensively than can the other four indicators.To make an overall evaluation, the performances of the NB ensemble are slightly better than those of the Naïve Bayes.
In Table 3, the average DR value of Naïve Bayes is 82.28%, whereas the average DR value of the five rules ranges from 81.93% to 89.63%.This indicates that the NB ensemble algorithm is more sensitive to the traffic incidents and can detect more traffic incidents than can the standard Naïve Bayes algorithm.The average MTTD value of NBTree is 1.36 min, which indicates that the NBTree algorithm can detect the incidents more quickly than NB ensemble algorithm.The average value of CR of NBTree is 98.31%, which indicates that NBTree can achieve the higher classification accuracy of the incident instance than can the Naïve Bayes and NB ensemble algorithm.The average Kappa value of NBTree is 0.8052, which indicates that the performance of NBTree classifier is significantly better than those of the other classifiers.In addition, it can detect more incidents than the NB ensemble, but the experimental results are not the same.The reason for this is that the FAR of NBTree is the highest.FAR improves the performance of the NBTree classifier.The MAE, RMSE, and EC of the product rule are best, which indicates that the predicted value of the product rule is the closest approximation.

Performance Evaluation Using AYE Dataset with Noisy
Data.From Figures 6 and 7, we can see that when the dataset includes noisy data, the performances of the sum rule, the max rule, and the min rule are still stable and significantly better than the performances of the product rule and the majority vote rule.In addition, we also find that the performances of the sum rule, the max rule, and the min rule are much better than those of the product rule and the majority vote rule on the indicators of DR, FAR, CR, and Kappa.Among the five rules, it appears that the min rule yields the highest average MAE, whereas the other rules are similar.As far as EC is concerned, the five rules perform at a similar level that is better than that of the NBTree.The opposite case The number of Naïve Bayes classifier ensembles  The number of NB classifier ensembles The number of Naïve Bayes classifier ensembles The number of NB classifier ensembles is observed with RMSE.Comparing Figure 4 and Figure 5, we find that the performances of all five rules are reduced in Figure 5.The reason for this is that the noisy data involved in the process of training a single classifier result in the final output of the NB ensemble being worse.However, the performances of the sum rule, the max rule, and the min rule are reduced, which indicates that the sum rule, the max rule, and the min rule have a better ability to tolerate the noisy data among the five rules.
In Tables 3 and 4, the dataset we used is extremely unbalanced.A very high CR, even exceeding 90%, does not indicate good detection performance.In Table 4, the average DR value of the Naïve Bayes algorithm is 71.12% and the average DR value of the NBTree algorithm is 72.75%.Both values are less than 75%, which is unsatisfactory for practical applications.The DR values of the product rule and the majority rule are even lower (64.57% and 62.46%, resp.).These results indicate that if the average accuracy of the individual NB classifiers is lower, the average accuracy of the ensemble classifiers, which are constructed using these individual classifiers, will become even lower than the average accuracy of the individual NB classifiers in certain combination rules.
Therefore, we should avoid drawing noisy data into the NB ensemble.The standard Naïve Bayes and NBtree are both individual classifiers, and they only need to train one time.In contrast to standard Naïve Bayes and NBtree, NB ensemble needs to train many individual NB classifiers to construct the NB ensemble.The training time of the NB ensemble is relatively long.From Figures 4(a)-4(f), we can see that in order to obtain relatively better performance, the NB ensemble needs approximately 15 individual NB to construct the NB ensemble; that is, the NB ensemble algorithm needs to train 15 times.Thus, compared with NB ensemble, the NBtree algorithm saves a large amount of time cost.

Conclusions
The Naïve Bayes classifier ensemble is a type of ensemble classifier based on Naïve Bayes for AID.In contrast to Naïve Bayes, the NB classifier ensemble algorithm trains many individual NB classifiers to construct the classifier ensemble and then uses this classifier ensemble to detect the traffic incidents, and it avoids the burden of choosing the optimal threshold and tuning the parameters.In our research, we take the traffic incident detection problem as a binary classification problem based on the ILD data and use the NB ensemble to divide the traffic patterns into two groups: an incident traffic pattern and nonincident traffic pattern.In this paper, we have performed two groups of experiments to evaluate the performances of the three algorithms: standard Naïve Bayes, NB ensemble, and NBTree.In the first group of experiments, we used all the three algorithms as applied to the I-880 dataset without noisy data.The results indicate that the performances of the five rules of the NB ensemble are significantly better than those of standard Naïve Bayes and slightly better than those of NBTree in terms of some indicators.More importantly, the NB ensemble performance is very stable.To further test the stability of the three algorithms, we applied the three algorithms to the AYE dataset with noisy data in the second group of experiments.The experimental results indicate that the NB ensemble has the best ability to tolerate the noisy data among the three algorithms.After analyzing the experimental results, we found that if the average accuracy of the individual NB classifiers is lower, the average accuracy of the ensemble classifiers constructed by these individual classifiers will become even lower than the average accuracy of the individual NB classifiers.To obtain good results for the NB ensemble classifier, we should avoid drawing the noisy data into the ensemble.NBTree is an individual classifier that needs to train only one time, whereas the NB ensemble needs to train many individual NB classifiers to construct the NB ensemble.As a result, compared with the NBTree algorithm, the NBTree algorithm reduces the time cost.The contribution of this paper is that it presents the development of a freeway incident detection model based on the Naïve Bayes classifier ensemble algorithm.The NB ensemble not only improves the performances of traffic incidents detection but also enhances the stability of the performances with an increased number of classifiers.The advantage of NBTree is that the MTTD value is better than that of the NB ensemble algorithm.We believe that the NB ensemble algorithm and NBTree can be successfully utilized in traffic incidents detection and the other classification problems.In a future study, we will concentrate on constructing an NB ensemble and scaling up the accuracy of NBTree to detect traffic incidents.

Figure 4 :
Figure 4: Experimental results of five rules for the Naïve Bayes ensembles as applied to the I-880 dataset: (a) performance with DR; (b) performance with FAR; (c) performance with MTTD; (d) performance with CR; (e) performance with AUC; (f) performance with Kappa.

Figure 5 :
Figure 5: Bar chart comparison of five rules for Naïve Bayes classifier ensembles as applied to the I-880 dataset.The red bar is MAE, the green bar is RMSE, and the blue bar is EC.

Figure 7 :
Figure 7: Bar chart comparison of five rules for Naïve Bayes classifier ensembles as applied to the AYE dataset.The red bar is MAE, the green bar is RMSE, and the blue bar is EC.
) for all classes  ∈  and (  | ) for all features  = 1, 2, . . .,  and all feature values   from the training set.In the test stage, a test instance will be predicted with label  if  leads to the largest value of all the class labels "traffic state" is a label.The value of the label is −1 or 1, referring to nonincident or incident, respectively, which is determined by the incident dataset.Typically, the model is fit for part of the data (the training set), and the quality of the fit is judged by how well it predicts the other part of the data (the test set).The entire dataset was divided into two parts: a training set that was used to build the model and a test set that was used to test the model's detection ability.Where each row is composed of one observation,  is the number of instances and   ∈ {−1, 1}.The data analysis problem is to relate the matrix  as some function of the matrix  to predict  (e.g., traffic state) using the data of ,  = ().The training set was used to develop a Naïve Bayes classifier ensemble that was, in turn, used to detect incidents for the test set samples.The output values of the detection models were then compared with the actual ones for each of the calibration samples, and the performance criteria were calculated and compared.
, A1, namely, the first attribute, so the number of variables (predictor variables) is 6.This means that the matrix  used in training the model has the size   ×6.The test data  form a matrix of size   × 6.The formal description of matrix  and  can be written as shown in Figure2.One instance consists of at least the following items:(i) speed, volume, and occupancy of the upstream detec-4.1.3.Experiments Procedures.The experiments were performed according to the procedures as shown in Figure3.Step 1. Divide the whole dataset  into training set  and test set .We take part of the whole dataset  as the training set , the other as test set  and use the parameter   to control the size of the training set , and  is obtained by taking out   samples from the front to the back of .Step 2. Perform sampling with replacement from training set   times and then obtain the training subsets  1 ,  2 , . . .,   .We use the parameter  to control the ratio of the number of samples in the training subset to the number of samples in the training set; that is, the number of samples in the training subset is  sub =   × .The range of  is [0, 1].Step 3.While  = 1, 2, 3, . . ., , perform the following: (1) use the training subset   to train the th individual NB classifier INBC  ; (2) use the training subset   to train the th NBTree classifier INBTreeC  ; Speed up 1 Volume up 1 Occupancy up 1 Speed dn 1 Volume dn 1 Occupancy dn 1 Speed up n Volume up n Occupancy up n Speed dn n Volume dn n Occupancy dn nFigure 2: Construction of traffic datasets.
1) test the performances of the th individual NB classifier INBC  on test set ; (2) test the performances of the th NBTree classifier INBTreeC  on test set ; (3) test the performances of the th ensemble NB classifier ENBC  on test set .

Table 1 :
Definition of Symbols and Parameters.sub to     The number of samples in test set    The number of samples in training set   all The total number of samples in the whole dataset   sub The number of samples in the training subset (each training subset has the same number of samples)  incident The number of incident samples in the whole dataset  nonincidentThe number of non-incident samples in the whole dataset • • •Naïve Bayes classifierFigure 3: A freeway incident detection model based on Naïve Bayes classifier ensemble.

Table 2 :
Parameter Setting of Experiments.
training set and the testing set, respectively.Each instance has seven features.In addition to the measurements of speed, volume, and occupancy collected at both the upstream detector station and the downstream detector station, the last one is the class label, −1 for nonincident state and 1 for incident state.

Table 3 :
Experimental Results of NB, Five Rules and NBTree Based as Applied to the I-880 Dataset (The performances are presented in the form average ± variance).

Table 4 :
Experimental Results of NB, Five Rules and NBTree Based as Applied to the AYE Dataset (The performances are presented in the form average ± variance).