APM_Exercises icon indicating copy to clipboard operation
APM_Exercises copied to clipboard

Minor bug in createGrantData.R code in AppliedPredictiveModeling

Open notesofdabbler opened this issue 9 years ago • 0 comments

Thanks for the great book on Applied Predictive Modeling. I am learning a lot reading and working through it. I am not sure if this is the right place to leave this comment but this seemed related to APM book and so I am listing this here.

I was working through createGrantData.R code to create grantData dataset. It seems like line 375 should be modified:

# line 375
# Original line gives days from 1 to 31 and with this the code 12_Discriminant_Analysis.R doesn't work correctly
grantData$Day <- day(startTime)
# Modified the code to the following to get days of year (as described in text book, p284, fig 12.3) and this seems to give the plots
# shown in the text when 12_Discriminant_Analysis.R is run 
grantData$Day <- yday(startTime)

Also, is the following line part of the code to create the dataset

save(training,testing,pre2008,fullSet,reducedSet,file = "grantData.Rdata")

The version of AppliedPredictiveModeling package that I have is 1.1-6.

Shankar

notesofdabbler avatar Dec 22 '15 19:12 notesofdabbler