# Augmenting CCAM Infrastructure for Creating Smart Roads and Enabling Autonomous Driving
## 6 Validation of the CCAM for Autonomous Driving
### Experimental Setup  
We applied machine learning algorithms to our recorded dataset and predict the real values as closely as possible. To do so, we selected two types of datasets from our consolidated dataset bank. First, we tried and prepared a model to predict as accurately as possible the vehicle counts at a particular intersection, drawing from a subset of the original dataset that consists of over twenty-four days of records. For this, we selected a window of three consecutive days of data and perform data cleaning tasks on it to develop a sub-sample that our models may consume for training tasks. In addition to this, we also prepared an ML model that predicts the Wi-Fi device counts and help us model a mobility requirements prediction model. In this section, we described and discussed the detailed working of how we developed machine learning-based models to predict Wi-Fi communication prediction and vehicular number prediction models. For the vehicle count prediction model, the selected data are traditionally in an unclean format for ML models. Therefore, we initially tackled the task of predicting vehicle counts. To this end, we cleaned our dataset by removing all unwanted features. For instance, these are speed and station identifier. The cause for speed feature being dropped is the lack of data points for every vehicle in the dataset. To use the full potential of the ML regression algorithms, we prepared a subset of the dataset for our considered usecase. Next, we prepared a set of indexes to correctly align any inconsistencies in recorded samples, as they are recorded. Therefore, we created an index column that is sorted by the unix timestamp value. Therefore, it is much easier to calculate preceding and succeeding values. It is also important to mention that unix timestamp values were only used for our experimental purposes. Otherwise, the results are shown in 24-h format. Next, we created a list of features that we deemed important in predicting the vehicle count. We selected the features, namely, hour, minute, second, type of vehicle, and a onetime step forward shifted lag feature. The decision to create a lag feature is based on the importance of lag features being able to contribute much to predicting time series values, which is the case herein. This technique is used to increase model accuracy and they are used on the assumption that prior events may contain useful patterns or hidden contextual information that may be indicative of the patterns exhibited. The experimentation was conducted on a single intersection to highlight the potential of mobility management using machine learning. These ML models were trained using a  
Figure 15: WiFi density for a single day at each location. two-day subset of the overall dataset. Next, we split the selected data into 80% for training and the remaining 20% for evaluating purposes. Therefore, we used two days of traffic count measurements and features to train our regressor models. Next, we evaluated and calculated the model score as an evaluation category. To predict the time series dependent vehicle counts, we rely on a linear regression ML technique. These techniques are: linear regression, random forest linear regression, and gradient boost regressor. All of these techniques are available from the Scikit Learn ML library. Therefore, we used the library in conjunction with a few other libraries, i.e., Python Pandas data science library, Seaborn, and Matplotlib, for data visualizations and graph creation. Next, we run the experiments on a machine with an Intel core i7 6700 HQ processor with 16 GBs of primary memory. Hence, the training took three minutes, on average. For the WiFi device count prediction model, we develop an XGBoost-based linear regression for the Wi-Fi devices. In this connection, we took the recorded values for a total of five days of the data. Next, we selected features that would be best suited to the considered task. These features are: hour, minute, second, and lag shifted count.