| Type: | Package | 
| Title: | Traffic Predictions Using Neural Networks | 
| Version: | 0.1.2 | 
| Date: | 2023-03-17 | 
| Description: | Estimate and return either the traffic speed or the car entries in the city of Thessaloniki using historical traffic data. It's used in transport pilot of the 'BigDataEurope' project. There are functions for processing these data, training a neural network, select the most appropriate model and predict the traffic speed or the car entries for a selected time date. | 
| Author: | Kleanthis Koupidis [aut, cre], Aikaterini Chatzopoulou [aut], Charalampos Bratsas [aut], Panagiotis Tzenos [dtc], Josep Maria Salanova [dtc] | 
| Maintainer: | Kleanthis Koupidis <koupidis.okfgr@gmail.com> | 
| URL: | https://github.com/okgreece/TrafficBDE | 
| BugReports: | https://github.com/okgreece/TrafficBDE/issues | 
| License: | GPL-2 | file LICENSE | 
| Encoding: | UTF-8 | 
| LazyData: | true | 
| Imports: | caret, data.table, DescriptiveStats.OBeu, dplyr, lubridate, RCurl, stats, zoo | 
| Suggests: | devtools, knitr, neuralnet, rmarkdown | 
| VignetteBuilder: | knitr | 
| RoxygenNote: | 7.2.1 | 
| NeedsCompilation: | no | 
| Packaged: | 2023-03-17 11:35:12 UTC; akis_ | 
| Depends: | R (≥ 3.5.0) | 
| Repository: | CRAN | 
| Date/Publication: | 2023-03-17 12:10:13 UTC | 
PreProcessing second model
Description
This function processes the data.
Usage
PreProcessingLink(DataList)
Arguments
| DataList | A list with the following components: trainData, testData, trainDataWide, cormat | 
Details
This function returns as a list object the parameters needed to train the model and predict.
Value
A list with the following components:
- trainset The trainset for the model 
- testset The testset to be predict 
- Minimum The min values of each column of the initial dataset 
- Maximum The max values of each column of the initial dataset 
Author(s)
Aikaterini Chatzopoulou, Kleanthis Koupidis
Examples
## Not run: 
SpecLink <- loadDataSpecLink("163204843","1", X163204843_1)
x <- fillMissingValues(SpecLink)
datetime <- "2017-01-27 14:00:00" 
newData <- fillMissingDates (x, datetime)
DataList <- loadTrainTest (newData, datetime, "Mean_speed")
List <- PreProcessingLink(DataList)
## End(Not run)
Prediction
Description
This function predicts the average speed of the road.
Usage
PredictionCR(List,NNOut,predict)
Arguments
| List | A list with the following components: trainset, testset, MinMaxFromScaling | 
| NNOut | The train model | 
| predict | The value to be predicted | 
Details
This function returns the predicted average speed.
Value
The predicted average speed of the road
Author(s)
Aikaterini Chatzopoulou, Kleanthis Koupidis, Charalampos Bratsas
See Also
Examples
## Not run: 
SpecLink <- loadDataSpecLink("163204843","1", X163204843_1)
x <- fillMissingValues(SpecLink)
datetime <- "2017-01-27 14:00:00" 
newData <- fillMissingDates (x, datetime)
DataList <- loadTrainTest (newData, datetime, "Mean_speed")
List <- PreProcessingLink(DataList)
NNOut <- TrainCR (List,"Mean_speed")
predicted <- PredictionCR(List,NNOut,"Mean_speed")
## End(Not run)
Train
Description
This function trains the model.
Usage
TrainCR(List,predict)
Arguments
| List | A list with the following components: trainset, testset, Min, Max | 
| predict | The value to be predicted | 
Details
This function returns the trained model.
Value
The train model
Author(s)
Aikaterini Chatzopoulou, Kleanthis Koupidis
See Also
Examples
## Not run: 
SpecLink <- loadDataSpecLink("163204843","1", X163204843_1)
x <- fillMissingValues(SpecLink)
datetime <- "2017-01-27 14:00:00" 
newData <- fillMissingDates (x, datetime)
DataList <- loadTrainTest (newData, datetime, "Mean_speed")
List <- PreProcessingLink(DataList)
NNout <- TrainCR (List,"Mean_speed")
## End(Not run)
Sample data from Traffic BDE
Description
Sample data of the traffic data of the road with Lik id "163204843" and direction = "1"
- The Link id of the road 
- The direction of the road 
- The date and time of the recorded arguments 
- The min speed each time 
- The max speed each time 
- The mean speed each time 
- The standard deviation of the speed 
- The skewness of the speed 
- The kurtosis of the speed 
- The entries each time 
- The unique entries each time 
Format
RData file
Source
TrafficBDE
Fill Missing Dates
Description
This function fills the missing dates from the data.
Usage
fillMissingDates(Data, datetime)
Arguments
| Data | The historical data | 
| datetime | The datetime wanted | 
Details
This function returns a data frame without missing dates.
Value
A data frame with all the historical data between the first date and the date wanted.
Author(s)
Aikaterini Chatzopoulou, Charalampos Bratsas
See Also
Examples
## Not run: 
SpecLink <- loadDataSpecLink("163204843","1", X163204843_1)
x <- fillMissingValues(SpecLink)
datetime <- "2017-01-27 14:00:00" 
newData <- fillMissingDates (x, datetime)
## End(Not run)
Fill Missing Values
Description
This function fills the missing values from the data.
Usage
fillMissingValues(Data)
Arguments
| Data | The historical data of the roads of Thessaloniki | 
Details
This function returns a data frame without missing values.
Value
A data frame with all the historical data without missing values
Author(s)
Aikaterini Chatzopoulou, Kleanthis Koupidis, Charalampos Bratsas
See Also
Examples
SpecLink <- loadDataSpecLink("163204843","1", X163204843_1)
x <- fillMissingValues(SpecLink)
k Steps Forward
Description
This function predictes the wanted value after k steps.
Usage
kStepsForward (Data, Link_id, direction, datetime, predict, steps)
Arguments
| Data | A data frame with the historical data | 
| Link_id | A character with the id of the road needed | 
| direction | The direction of the road | 
| datetime | The datetime wanted | 
| predict | The value to be predicted | 
| steps | The number of steps | 
Details
This function returns the predicted value after k steps.
Value
The predicted value
Author(s)
Aikaterini Chatzopoulou, Kleanthis Koupidis, Charalampos Bratsas
See Also
Examples
## Not run: 
kStepsForward (X163204843_1, "163204843", "1", "2017-01-27 14:00:00", "Mean_speed", 1)
## End(Not run)
Load traffic data
Description
This function loads the traffic data.
Usage
loadData(path)
Arguments
| path | The path where the data are. | 
Details
This function returns a data frame with the traffic data of the roads of Thessaloniki ordered by the roads.
Value
Returns a data frame.
Author(s)
Aikaterini Chatzopoulou, Kleanthis Koupidis, Charalampos Bratsas
Load data for a specific road of Thessaloniki
Description
This function extracts the data of one road of Thessaloniki.
Usage
loadDataSpecLink(Link_id, direction, Data)
Arguments
| Link_id | A character with the id of the road needed | 
| direction | The direction of the road | 
| Data | The historical data of the roads of Thessaloniki | 
Details
This function returns a data frame with the historical data of a specific road.
Value
A data frame with the data of a specific road
Author(s)
Aikaterini Chatzopoulou, Kleanthis Koupidis
See Also
Load Train and Test Data
Description
This function returns a list with the train and test data.
Usage
loadTrainTest(Data, datetime, predict)
Arguments
| Data | The historical data | 
| datetime | The date time the user wants to predict | 
| predict | The value he user wants to predict must be a column name of the data set | 
Details
This function returns a list with the train and test data that will be used for train and prediction.
Value
A list with the following components:
- trainsData The trainData for the model 
- testsData The testData to be predict 
Author(s)
Aikaterini Chatzopoulou, Kleanthis Koupidis, Charalampos Bratsas
Examples
## Not run: 
SpecLink <- loadDataSpecLink("163204843","1", X163204843_1)
x <- fillMissingValues(SpecLink)
datetime <- "2017-01-27 14:00:00" 
newData <- fillMissingDates (x, datetime)
DataList <- loadTrainTest (newData, datetime, "Mean_speed")
## End(Not run)