This document shows the usage scenarios for the Telematics package. Their are two entry points to using the package. 1) If you do not have a Master Summary File created and you want to create One 2) If you have a Master Summary File and you want to load it and do some analysis
Defining some variable
library(package = "niraj9.telematics") public.folder = "/home/niraj9/public/" master.file.3 = paste(public.folder , "master-3.csv" , sep = "") master.file.4 = paste(public.folder , "master-4.csv" , sep = "")
telematics <- Telematics$new(master.file.4) arun = telematics$CreateMasterSummary(file.list = "/home/niraj9/public/fileList.csv" , root.folder = "/home/niraj9/public/drivers/", subset.driver.count = 30 , cores =4)
telematics <- Telematics$new(master.file.3) telematics$load(verbose = FALSE)
telematics$drivers()
Load a Driver
driver = Driver$new(db = telematics , driver.name = "2751") driver$summary()
q =driver$ShowCoordinates(trip = 165) q =driver$ShowVelocity(trip = 165) q =driver$ShowAcceleration(trip = 165) q =driver$ShowBreaks(trip = 165) q=driver$ShowQuantiles(trip = 111) q=driver$ShowSpeedBreaks(trip = 120)
Create a Unique Driver Signature. i.e a GBM Model that can identify a driver
model = driver$CreateDriverSignature() summary(model)
Use the Telematics class to segment the drivers into 5 driver classes
fit <- telematics$SegmentDrivers(segments = 5) summary(fit)
Visualize the Driver Clusters
telematics$VisualizeSegments()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.