ast
stringlengths 16
2.64M
|
---|
[](){expression}<LSEP>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){ggplot2}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){readr}<LEND>[call](){}<LSEP>[](symbol){system}<LSEP>[argument 0; litteral](str){ls ../input}<LEND>[assign](){<-}<LSEP>[](symbol){data}<LEND>[call](){}<LSEP>[](symbol){read.table}<LSEP>[argument 0; litteral](logical){TRUE}<LSEP>[argument 1; litteral](str){\n subject sex size\n 1 ...}<LEND>[call](){}<LSEP>[](symbol){write.csv}<LSEP>[](symbol){data}<LSEP>[argument 1; litteral](str){output.csv}<LSEP>[argument 2; litteral](logical){FALSE} |
[](){expression}<LSEP>[call](){}<LSEP>[](symbol){library}<LSEP>[argument 0; litteral](str){e1071}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){lattice}<LEND>[assign](){<-}<LSEP>[](symbol){data}<LEND>[call](){}<LSEP>[](symbol){read.csv}<LSEP>[argument 0; litteral](str){../input/train.csv}<LSEP>[](symbol){T}<LEND>[assign](){=}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){data}<LSEP>[](symbol){Cover_Type}<LEND>[call](){}<LSEP>[](symbol){as.factor}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){data}<LSEP>[](symbol){Cover_Type}<LEND>[assign](){=}<LSEP>[](symbol){x}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){data}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){c}<LEND>[argument 0; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){2.000000}<LSEP>[argument 1; litteral](real){11.000000}<LEND>[argument 1; litteral](real){12.000000}<LSEP>[argument 2; litteral](real){14.000000}<LSEP>[argument 3; litteral](real){15.000000}<LSEP>[argument 4; litteral](real){25.000000}<LEND>[assign](){=}<LSEP>[](symbol){y}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){data}<LSEP>[](symbol){}<LSEP>[argument 2; litteral](real){56.000000}<LEND>[assign](){=}<LSEP>[](symbol){model}<LEND>[call](){}<LSEP>[](symbol){svm}<LSEP>[](symbol){x}<LSEP>[](symbol){y}<LSEP>[argument 2; litteral](str){radial}<LEND>[argument 3; control flow](){if}<LSEP>[condition; call](){}<LSEP>[](symbol){is.vector}<LSEP>[](symbol){x}<LEND>[true branch; litteral](real){1.000000}<LEND>[false branch; call](){}<LSEP>[](symbol){/}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){ncol}<LSEP>[](symbol){x}<LEND>[assign](){<-}<LSEP>[](symbol){test}<LEND>[call](){}<LSEP>[](symbol){read.csv}<LSEP>[argument 0; litteral](str){../input/test.csv}<LSEP>[](symbol){T}<LEND>[assign](){=}<LSEP>[](symbol){x1}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){test}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){c}<LEND>[argument 0; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){2.000000}<LSEP>[argument 1; litteral](real){11.000000}<LEND>[argument 1; litteral](real){12.000000}<LSEP>[argument 2; litteral](real){14.000000}<LSEP>[argument 3; litteral](real){15.000000}<LSEP>[argument 4; litteral](real){25.000000}<LEND>[assign](){<-}<LSEP>[](symbol){pred}<LEND>[call](){}<LSEP>[](symbol){predict}<LSEP>[](symbol){model}<LSEP>[](symbol){x1}<LEND>[assign](){=}<LSEP>[](symbol){sample_submission}<LEND>[call](){}<LSEP>[](symbol){read.csv}<LSEP>[argument 0; litteral](str){../input/sample_submission.csv}<LSEP>[argument 1; litteral](logical){TRUE}<LSEP>[argument 2; litteral](str){,}<LEND>[assign](){=}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){sample_submission}<LSEP>[](symbol){Cover_Type}<LEND>[](symbol){pred}<LEND>[call](){}<LSEP>[](symbol){write.csv}<LSEP>[](symbol){sample_submission}<LSEP>[argument 1; litteral](str){sub_0.csv}<LSEP>[argument 2; litteral](logical){FALSE} |
[](){expression}<LSEP>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){readr}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){mice}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){ROCR}<LEND>[assign](){<-}<LSEP>[](symbol){trainOr}<LEND>[call](){}<LSEP>[](symbol){read.csv}<LSEP>[argument 0; litteral](str){../input/train.csv}<LEND>[call](){}<LSEP>[](symbol){set.seed}<LSEP>[argument 0; litteral](real){3.000000}<LEND>[assign](){<-}<LSEP>[](symbol){trainOr1}<LSEP>[](symbol){trainOr}<LEND>[assign](){<-}<LSEP>[](symbol){ind}<LEND>[call](){}<LSEP>[](symbol){sample}<LSEP>[argument 0; litteral](real){2.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){nrow}<LSEP>[](symbol){trainOr}<LEND>[](symbol){T}<LEND>[argument 3; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](real){0.700000}<LSEP>[argument 1; litteral](real){0.300000}<LEND>[assign](){<-}<LSEP>[](symbol){trainOr1}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){trainOr}<LEND>[argument 1; call](){}<LSEP>[](symbol){==}<LSEP>[](symbol){ind}<LSEP>[argument 1; litteral](real){1.000000}<LEND>[](symbol){}<LEND>[assign](){<-}<LSEP>[](symbol){testOr1}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){trainOr}<LEND>[argument 1; call](){}<LSEP>[](symbol){==}<LSEP>[](symbol){ind}<LSEP>[argument 1; litteral](real){2.000000}<LEND>[](symbol){}<LEND>[assign](){<-}<LSEP>[](symbol){trainOr1}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){trainOr1}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](real){2.000000}<LSEP>[argument 1; litteral](real){3.000000}<LSEP>[argument 2; litteral](real){5.000000}<LSEP>[argument 3; litteral](real){6.000000}<LSEP>[argument 4; litteral](real){7.000000}<LSEP>[argument 5; litteral](real){8.000000}<LSEP>[argument 6; litteral](real){12.000000}<LEND>[assign](){<-}<LSEP>[](symbol){testOr1}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){testOr1}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](real){2.000000}<LSEP>[argument 1; litteral](real){3.000000}<LSEP>[argument 2; litteral](real){5.000000}<LSEP>[argument 3; litteral](real){6.000000}<LSEP>[argument 4; litteral](real){7.000000}<LSEP>[argument 5; litteral](real){8.000000}<LSEP>[argument 6; litteral](real){12.000000}<LEND>[assign](){<-}<LSEP>[](symbol){trainOr1}<LEND>[call](){}<LSEP>[](symbol){as.data.frame}<LEND>[argument 0; call](){}<LSEP>[](symbol){unclass}<LSEP>[](symbol){trainOr1}<LEND>[assign](){<-}<LSEP>[](symbol){testOr1}<LEND>[call](){}<LSEP>[](symbol){as.data.frame}<LEND>[argument 0; call](){}<LSEP>[](symbol){unclass}<LSEP>[](symbol){testOr1}<LEND>[assign](){<-}<LSEP>[](symbol){cols}<LEND>[call](){}<LSEP>[](symbol){colnames}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){trainOr1}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](real){1.000000}<LSEP>[argument 1; litteral](real){2.000000}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){trainOr1}<LSEP>[](symbol){}<LSEP>[](symbol){cols}<LEND>[call](){}<LSEP>[](symbol){data.frame}<LEND>[argument 0; call](){}<LSEP>[](symbol){apply}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){trainOr1}<LSEP>[](symbol){cols}<LEND>[argument 1; litteral](real){2.000000}<LSEP>[](symbol){as.factor}<LEND>[assign](){<-}<LSEP>[](symbol){cols}<LEND>[call](){}<LSEP>[](symbol){colnames}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){testOr1}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](real){1.000000}<LSEP>[argument 1; litteral](real){2.000000}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){testOr1}<LSEP>[](symbol){}<LSEP>[](symbol){cols}<LEND>[call](){}<LSEP>[](symbol){data.frame}<LEND>[argument 0; call](){}<LSEP>[](symbol){apply}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){testOr1}<LSEP>[](symbol){cols}<LEND>[argument 1; litteral](real){2.000000}<LSEP>[](symbol){as.factor}<LEND>[call](){}<LSEP>[](symbol){colSums}<LEND>[argument 0; call](){}<LSEP>[](symbol){is.na}<LSEP>[](symbol){trainOr1}<LEND>[assign](){<-}<LSEP>[](symbol){tempData}<LEND>[call](){}<LSEP>[](symbol){mice}<LSEP>[](symbol){trainOr1}<LSEP>[argument 1; litteral](real){5.000000}<LSEP>[argument 2; litteral](real){50.000000}<LSEP>[argument 3; litteral](str){pmm}<LSEP>[argument 4; litteral](real){500.000000}<LEND>[assign](){<-}<LSEP>[](symbol){trainOr1}<LEND>[call](){}<LSEP>[](symbol){complete}<LSEP>[](symbol){tempData}<LSEP>[argument 1; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[](symbol){tempDatatest}<LEND>[call](){}<LSEP>[](symbol){mice}<LSEP>[](symbol){testOr1}<LSEP>[argument 1; litteral](real){5.000000}<LSEP>[argument 2; litteral](real){50.000000}<LSEP>[argument 3; litteral](str){pmm}<LSEP>[argument 4; litteral](real){500.000000}<LEND>[assign](){<-}<LSEP>[](symbol){testOr1}<LEND>[call](){}<LSEP>[](symbol){complete}<LSEP>[](symbol){tempDatatest}<LSEP>[argument 1; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[](symbol){train.model}<LEND>[call](){}<LSEP>[](symbol){glm}<LEND>[argument 0; call](){}<LSEP>[](symbol){~}<LSEP>[](symbol){Survived}<LEND>[argument 1; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LSEP>[](symbol){Sex}<LSEP>[](symbol){Pclass}<LEND>[](symbol){Age}<LEND>[](symbol){SibSp}<LEND>[](symbol){Parch}<LEND>[](symbol){Embarked}<LEND>[argument 1; litteral](str){binomial}<LSEP>[](symbol){trainOr1}<LEND>[assign](){<-}<LSEP>[](symbol){predtest}<LEND>[call](){}<LSEP>[](symbol){predict}<LSEP>[](symbol){train.model}<LSEP>[](symbol){testOr1}<LSEP>[argument 2; litteral](str){response}<LEND>[assign](){<-}<LSEP>[](symbol){pred}<LEND>[call](){}<LSEP>[](symbol){prediction}<LSEP>[](symbol){predtest}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){testOr1}<LSEP>[](symbol){Survived}<LEND>[assign](){<-}<LSEP>[](symbol){eval}<LEND>[call](){}<LSEP>[](symbol){performance}<LSEP>[](symbol){pred}<LSEP>[argument 1; litteral](str){acc}<LEND>[call](){}<LSEP>[](symbol){plot}<LSEP>[](symbol){eval}<LEND>[assign](){<-}<LSEP>[](symbol){eval1}<LEND>[call](){}<LSEP>[](symbol){performance}<LSEP>[](symbol){pred}<LSEP>[argument 1; litteral](str){tpr}<LSEP>[argument 2; litteral](str){fpr}<LEND>[call](){}<LSEP>[](symbol){plot}<LSEP>[](symbol){eval1}<LSEP>[](symbol){T}<LEND>[assign](){<-}<LSEP>[](symbol){auc}<LEND>[call](){}<LSEP>[](symbol){performance}<LSEP>[](symbol){pred}<LSEP>[argument 1; litteral](str){auc}<LEND>[assign](){<-}<LSEP>[](symbol){auc}<LEND>[call](){}<LSEP>[](symbol){unlist}<LEND>[argument 0; call](){}<LSEP>[](symbol){slot}<LSEP>[](symbol){auc}<LSEP>[argument 1; litteral](str){y.values}<LEND>[assign](){<-}<LSEP>[](symbol){auc}<LEND>[call](){}<LSEP>[](symbol){round}<LSEP>[](symbol){auc}<LSEP>[argument 1; litteral](real){2.000000}<LEND>[call](){}<LSEP>[](symbol){legend}<LSEP>[argument 0; litteral](real){0.800000}<LSEP>[argument 1; litteral](real){0.400000}<LSEP>[](symbol){auc}<LSEP>[argument 3; litteral](str){AUC}<LSEP>[argument 4; litteral](real){1.000000}<LSEP>[](symbol){T}<LEND>[assign](){<-}<LSEP>[](symbol){max}<LEND>[call](){}<LSEP>[](symbol){which.max}<LEND>[argument 0; call](){}<LSEP>[](symbol){[[}<LEND>[argument 0; call](){}<LSEP>[](symbol){slot}<LSEP>[](symbol){eval}<LSEP>[argument 1; litteral](str){y.values}<LEND>[argument 1; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[](symbol){acc}<LEND>[call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){[[}<LEND>[argument 0; call](){}<LSEP>[](symbol){slot}<LSEP>[](symbol){eval}<LSEP>[argument 1; litteral](str){y.values}<LEND>[argument 1; litteral](real){1.000000}<LEND>[](symbol){max}<LEND>[assign](){<-}<LSEP>[](symbol){cut}<LEND>[call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){[[}<LEND>[argument 0; call](){}<LSEP>[](symbol){slot}<LSEP>[](symbol){eval}<LSEP>[argument 1; litteral](str){x.values}<LEND>[argument 1; litteral](real){1.000000}<LEND>[](symbol){max}<LEND>[call](){}<LSEP>[](symbol){print}<LEND>[argument 0; call](){}<LSEP>[](symbol){c}<LSEP>[](symbol){acc}<LSEP>[](symbol){cut}<LEND>[assign](){<-}<LSEP>[](symbol){testOr}<LEND>[call](){}<LSEP>[](symbol){read.csv}<LSEP>[argument 0; litteral](str){../input/test.csv}<LEND>[assign](){<-}<LSEP>[](symbol){testOr}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){testOr}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](real){2.000000}<LSEP>[argument 1; litteral](real){4.000000}<LSEP>[argument 2; litteral](real){5.000000}<LSEP>[argument 3; litteral](real){6.000000}<LSEP>[argument 4; litteral](real){7.000000}<LSEP>[argument 5; litteral](real){11.000000}<LEND>[assign](){<-}<LSEP>[](symbol){testOr}<LEND>[call](){}<LSEP>[](symbol){as.data.frame}<LEND>[argument 0; call](){}<LSEP>[](symbol){unclass}<LSEP>[](symbol){testOr}<LEND>[assign](){<-}<LSEP>[](symbol){cols}<LEND>[call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){colnames}<LSEP>[](symbol){testOr}<LEND>[argument 1; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){testOr}<LSEP>[](symbol){cols}<LEND>[call](){}<LSEP>[](symbol){data.frame}<LEND>[argument 0; call](){}<LSEP>[](symbol){apply}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){testOr}<LSEP>[](symbol){cols}<LEND>[argument 1; litteral](real){2.000000}<LSEP>[](symbol){as.factor}<LEND>[assign](){<-}<LSEP>[](symbol){tempData}<LEND>[call](){}<LSEP>[](symbol){mice}<LSEP>[](symbol){testOr}<LSEP>[argument 1; litteral](real){5.000000}<LSEP>[argument 2; litteral](real){50.000000}<LSEP>[argument 3; litteral](str){pmm}<LSEP>[argument 4; litteral](real){500.000000}<LEND>[assign](){<-}<LSEP>[](symbol){testOr}<LEND>[call](){}<LSEP>[](symbol){complete}<LSEP>[](symbol){tempData}<LSEP>[argument 1; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[](symbol){survivaltest}<LEND>[call](){}<LSEP>[](symbol){predict}<LSEP>[](symbol){train.model}<LSEP>[](symbol){testOr}<LSEP>[argument 2; litteral](str){response}<LEND>[assign](){<-}<LSEP>[](symbol){survivaltest}<LEND>[call](){}<LSEP>[](symbol){as.data.frame}<LSEP>[](symbol){survivaltest}<LEND>[assign](){=}<LSEP>[](symbol){survivalpred}<LEND>[call](){}<LSEP>[](symbol){rep}<LSEP>[argument 0; litteral](real){0.000000}<LSEP>[argument 1; litteral](real){418.000000}<LEND>[assign](){=}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){survivalpred}<LEND>[argument 1; call](){}<LSEP>[](symbol){>}<LSEP>[](symbol){survivaltest}<LSEP>[argument 1; litteral](real){0.640000}<LEND>[litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[](symbol){survivalpred}<LEND>[call](){}<LSEP>[](symbol){as.data.frame}<LSEP>[](symbol){survivalpred} |
[](){expression}<LSEP>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){dplyr}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){forecast}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){reshape2}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){data.table}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){foreach}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){date}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){lubridate}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){doMC}<LEND>[assign](){<-}<LSEP>[](symbol){train}<LEND>[call](){}<LSEP>[](symbol){fread}<LSEP>[argument 0; litteral](str){../input/train.csv}<LSEP>[argument 1; litteral](real){86672217.000000}<LSEP>[argument 2; litteral](logical){FALSE}<LEND>[argument 3; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){2.000000}<LSEP>[argument 1; litteral](real){5.000000}<LEND>[call](){}<LSEP>[](symbol){setnames}<LSEP>[](symbol){train}<LEND>[argument 1; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){date}<LSEP>[argument 1; litteral](str){store_nbr}<LSEP>[argument 2; litteral](str){item_nbr}<LSEP>[argument 3; litteral](str){unit_sales}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){date}<LEND>[call](){}<LSEP>[](symbol){as.Date}<LEND>[argument 0; call](){}<LSEP>[](symbol){parse_date_time}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){date}<LEND>[argument 1; litteral](str){%y-%m-%d}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){store_item_nbr}<LEND>[call](){}<LSEP>[](symbol){paste}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){store_nbr}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){item_nbr}<LEND>[argument 2; litteral](str){_}<LEND>[assign](){<-}<LSEP>[](symbol){train_sub}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){train}<LEND>[argument 1; call](){}<LSEP>[](symbol){>=}<LSEP>[](symbol){date}<LEND>[argument 1; call](){}<LSEP>[](symbol){as.Date}<LSEP>[argument 0; litteral](str){2017-01-01}<LEND>[](symbol){}<LEND>[assign](){<-}<LSEP>[](symbol){train_sub}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){train_sub}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){date}<LSEP>[argument 1; litteral](str){store_item_nbr}<LSEP>[argument 2; litteral](str){unit_sales}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train_sub}<LSEP>[](symbol){unit_sales}<LEND>[argument 1; call](){}<LSEP>[](symbol){<}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train_sub}<LSEP>[](symbol){unit_sales}<LEND>[argument 1; litteral](real){0.000000}<LEND>[litteral](real){0.000000}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train_sub}<LSEP>[](symbol){unit_sales}<LEND>[call](){}<LSEP>[](symbol){log1p}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train_sub}<LSEP>[](symbol){unit_sales}<LEND>[assign](){<-}<LSEP>[](symbol){train_sub_wide}<LEND>[call](){}<LSEP>[](symbol){dcast}<LSEP>[](symbol){train_sub}<LEND>[argument 1; call](){}<LSEP>[](symbol){~}<LSEP>[](symbol){store_item_nbr}<LSEP>[](symbol){date}<LEND>[argument 2; litteral](str){unit_sales}<LSEP>[argument 3; litteral](real){0.000000}<LEND>[assign](){<-}<LSEP>[](symbol){train_sub_col}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){train_sub_wide}<LSEP>[](symbol){}<LSEP>[argument 2; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[](symbol){train_ts}<LEND>[call](){}<LSEP>[](symbol){ts}<LSEP>[](symbol){train_sub_wide}<LSEP>[argument 1; litteral](real){7.000000}<LEND>[call](){}<LSEP>[](symbol){rm}<LSEP>[](symbol){train}<LSEP>[](symbol){train_sub}<LSEP>[](symbol){train_sub_wide}<LEND>[call](){}<LSEP>[](symbol){gc}<LEND>[assign](){=}<LSEP>[](symbol){fcst_intv}<LSEP>[litteral](real){16.000000}<LEND>[assign](){<-}<LSEP>[](symbol){fcst_matrix}<LEND>[call](){}<LSEP>[](symbol){matrix}<LSEP>[argument 0; litteral](logical){NA}<LEND>[argument 1; call](){}<LSEP>[](symbol){nrow}<LSEP>[](symbol){train_ts}<LEND>[](symbol){fcst_intv}<LEND>[call](){}<LSEP>[](symbol){registerDoMC}<LEND>[argument 0; call](){}<LSEP>[](symbol){-}<LEND>[argument 0; call](){}<LSEP>[](symbol){detectCores}<LEND>[argument 1; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[](symbol){fcst_matrix}<LEND>[call](){}<LSEP>[](symbol){%dopar%}<LEND>[argument 0; call](){}<LSEP>[](symbol){foreach}<LEND>[argument 0; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){nrow}<LSEP>[](symbol){train_ts}<LEND>[](symbol){rbind}<LEND>[argument 2; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){forecast}<LEND>[argument 1; block](){}<LSEP>[statement 0; assign](){<-}<LSEP>[](symbol){fcst_matrix}<LEND>[call](){}<LSEP>[](symbol){$}<LEND>[argument 0; call](){}<LSEP>[](symbol){forecast}<LEND>[argument 0; call](){}<LSEP>[](symbol){ets}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){train_ts}<LSEP>[](symbol){i}<LSEP>[](symbol){}<LEND>[](symbol){fcst_intv}<LEND>[](symbol){mean}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){fcst_matrix}<LEND>[argument 1; call](){}<LSEP>[](symbol){<}<LSEP>[](symbol){fcst_matrix}<LSEP>[argument 1; litteral](real){0.000000}<LEND>[litteral](real){0.000000}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){colnames}<LSEP>[](symbol){fcst_matrix}<LEND>[call](){}<LSEP>[](symbol){as.character}<LEND>[argument 0; call](){}<LSEP>[](symbol){seq}<LEND>[argument 0; call](){}<LSEP>[](symbol){as.Date}<LSEP>[argument 0; litteral](str){2017-08-16}<LEND>[argument 1; call](){}<LSEP>[](symbol){as.Date}<LSEP>[argument 0; litteral](str){2017-08-31}<LEND>[argument 2; litteral](str){day}<LEND>[assign](){<-}<LSEP>[](symbol){fcst_df}<LEND>[call](){}<LSEP>[](symbol){as.data.frame}<LEND>[argument 0; call](){}<LSEP>[](symbol){cbind}<LSEP>[](symbol){train_sub_col}<LSEP>[](symbol){fcst_matrix}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){colnames}<LSEP>[](symbol){fcst_df}<LEND>[argument 1; litteral](real){1.000000}<LEND>[litteral](str){store_item_nbr}<LEND>[assign](){<-}<LSEP>[](symbol){fcst_df_long}<LEND>[call](){}<LSEP>[](symbol){melt}<LSEP>[](symbol){fcst_df}<LSEP>[argument 1; litteral](str){store_item_nbr}<LSEP>[argument 2; litteral](str){fcst_date}<LSEP>[argument 3; litteral](str){unit_sales}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fcst_df_long}<LSEP>[](symbol){store_item_nbr}<LEND>[call](){}<LSEP>[](symbol){as.character}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fcst_df_long}<LSEP>[](symbol){store_item_nbr}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fcst_df_long}<LSEP>[](symbol){fcst_date}<LEND>[call](){}<LSEP>[](symbol){as.Date}<LEND>[argument 0; call](){}<LSEP>[](symbol){parse_date_time}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fcst_df_long}<LSEP>[](symbol){fcst_date}<LEND>[argument 1; litteral](str){%y-%m-%d}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fcst_df_long}<LSEP>[](symbol){unit_sales}<LEND>[call](){}<LSEP>[](symbol){as.numeric}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fcst_df_long}<LSEP>[](symbol){unit_sales}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fcst_df_long}<LSEP>[](symbol){unit_sales}<LEND>[call](){}<LSEP>[](symbol){expm1}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fcst_df_long}<LSEP>[](symbol){unit_sales}<LEND>[assign](){<-}<LSEP>[](symbol){test}<LEND>[call](){}<LSEP>[](symbol){fread}<LSEP>[argument 0; litteral](str){../input/test.csv}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){test}<LSEP>[](symbol){date}<LEND>[call](){}<LSEP>[](symbol){as.Date}<LEND>[argument 0; call](){}<LSEP>[](symbol){parse_date_time}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){test}<LSEP>[](symbol){date}<LEND>[argument 1; litteral](str){%y-%m-%d}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){test}<LSEP>[](symbol){store_item_nbr}<LEND>[call](){}<LSEP>[](symbol){paste}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){test}<LSEP>[](symbol){store_nbr}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){test}<LSEP>[](symbol){item_nbr}<LEND>[argument 2; litteral](str){_}<LEND>[assign](){<-}<LSEP>[](symbol){submission}<LEND>[call](){}<LSEP>[](symbol){left_join}<LSEP>[](symbol){test}<LSEP>[](symbol){fcst_df_long}<LEND>[argument 2; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){store_item_nbr}<LSEP>[argument 1; litteral](str){fcst_date}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){submission}<LSEP>[](symbol){unit_sales}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){submission}<LSEP>[](symbol){unit_sales}<LEND>[litteral](real){0.000000}<LEND>[assign](){<-}<LSEP>[](symbol){submission}<LEND>[call](){}<LSEP>[](symbol){select}<LSEP>[](symbol){submission}<LEND>[argument 1; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){id}<LSEP>[argument 1; litteral](str){unit_sales}<LEND>[call](){}<LSEP>[](symbol){write.csv}<LSEP>[](symbol){submission}<LSEP>[argument 1; litteral](str){sub_ets_log.csv}<LSEP>[argument 2; litteral](logical){FALSE} |
[](){expression}<LSEP>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){plyr}<LEND>[assign](){<-}<LSEP>[](symbol){Mode}<LEND>[](){function}<LSEP>[](pairlist){}<LSEP>[](symbol){x}<LEND>[body; block](){}<LSEP>[statement 0; assign](){<-}<LSEP>[](symbol){ux}<LEND>[call](){}<LSEP>[](symbol){unique}<LSEP>[](symbol){x}<LEND>[statement 1; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){ux}<LEND>[argument 1; call](){}<LSEP>[](symbol){which.max}<LEND>[argument 0; call](){}<LSEP>[](symbol){tabulate}<LEND>[argument 0; call](){}<LSEP>[](symbol){match}<LSEP>[](symbol){x}<LSEP>[](symbol){ux}<LEND>[assign](){<-}<LSEP>[](symbol){buildFrequencyTable}<LEND>[](){function}<LSEP>[](pairlist){}<LSEP>[](symbol){sequences}<LEND>[body; block](){}<LSEP>[statement 0; assign](){<-}<LSEP>[](symbol){pairs}<LEND>[call](){}<LSEP>[](symbol){ldply}<LSEP>[](symbol){sequences}<LEND>[](){function}<LSEP>[](pairlist){}<LSEP>[](symbol){sequence}<LEND>[body; block](){}<LSEP>[statement 0; assign](){<-}<LSEP>[](symbol){sequence}<LEND>[call](){}<LSEP>[](symbol){as.numeric}<LEND>[argument 0; call](){}<LSEP>[](symbol){unlist}<LEND>[argument 0; call](){}<LSEP>[](symbol){strsplit}<LSEP>[](symbol){sequence}<LSEP>[argument 1; litteral](str){,}<LEND>[statement 1; control flow](){if}<LSEP>[condition; call](){}<LSEP>[](symbol){<=}<LEND>[argument 0; call](){}<LSEP>[](symbol){length}<LSEP>[](symbol){sequence}<LEND>[argument 1; litteral](real){2.000000}<LEND>[true branch; block](){}<LSEP>[statement 0; call](){}<LSEP>[](symbol){return}<LSEP>[argument 0; litteral](NULL){NULL}<LEND>[statement 2; call](){}<LSEP>[](symbol){data.frame}<LEND>[argument 0; call](){}<LSEP>[](symbol){head}<LSEP>[](symbol){sequence}<LEND>[argument 1; call](){}<LSEP>[](symbol){-}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){tail}<LSEP>[](symbol){sequence}<LEND>[argument 1; call](){}<LSEP>[](symbol){-}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[statement 1; assign](){<-}<LSEP>[](symbol){frequencyTable}<LEND>[call](){}<LSEP>[](symbol){ddply}<LSEP>[](symbol){pairs}<LSEP>[argument 1; litteral](str){last}<LEND>[](){function}<LSEP>[](pairlist){}<LSEP>[](symbol){x}<LEND>[body; block](){}<LSEP>[statement 0; call](){}<LSEP>[](symbol){data.frame}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){x}<LSEP>[](symbol){last}<LEND>[argument 1; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){Mode}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){x}<LSEP>[](symbol){following}<LEND>[statement 2; call](){}<LSEP>[](symbol){return}<LSEP>[](symbol){frequencyTable}<LEND>[assign](){<-}<LSEP>[](symbol){data}<LEND>[call](){}<LSEP>[](symbol){read.csv}<LSEP>[argument 0; litteral](str){../input/test.csv}<LSEP>[argument 1; litteral](logical){FALSE}<LEND>[call](){}<LSEP>[](symbol){options}<LSEP>[argument 0; litteral](real){999.000000}<LEND>[assign](){<-}<LSEP>[](symbol){frequencyTable}<LEND>[call](){}<LSEP>[](symbol){buildFrequencyTable}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){data}<LSEP>[](symbol){Sequence}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){data}<LSEP>[](symbol){last}<LEND>[call](){}<LSEP>[](symbol){sapply}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){data}<LSEP>[](symbol){Sequence}<LEND>[](){function}<LSEP>[](pairlist){}<LSEP>[](symbol){sequence}<LEND>[body; call](){}<LSEP>[](symbol){as.numeric}<LEND>[argument 0; call](){}<LSEP>[](symbol){tail}<LEND>[argument 0; call](){}<LSEP>[](symbol){[[}<LEND>[argument 0; call](){}<LSEP>[](symbol){strsplit}<LSEP>[](symbol){sequence}<LSEP>[argument 1; litteral](str){,}<LEND>[argument 1; litteral](real){1.000000}<LEND>[argument 1; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){data}<LSEP>[](symbol){mode}<LEND>[call](){}<LSEP>[](symbol){sapply}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){data}<LSEP>[](symbol){Sequence}<LEND>[](){function}<LSEP>[](pairlist){}<LSEP>[](symbol){sequence}<LEND>[body; call](){}<LSEP>[](symbol){Mode}<LEND>[argument 0; call](){}<LSEP>[](symbol){as.numeric}<LEND>[argument 0; call](){}<LSEP>[](symbol){[[}<LEND>[argument 0; call](){}<LSEP>[](symbol){strsplit}<LSEP>[](symbol){sequence}<LSEP>[argument 1; litteral](str){,}<LEND>[argument 1; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[](symbol){data}<LEND>[call](){}<LSEP>[](symbol){join}<LSEP>[](symbol){data}<LSEP>[](symbol){frequencyTable}<LSEP>[argument 2; litteral](str){left}<LEND>[assign](){<-}<LSEP>[](symbol){submission}<LEND>[call](){}<LSEP>[](symbol){data.frame}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){data}<LSEP>[](symbol){Id}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){data}<LSEP>[](symbol){following}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){submission}<LSEP>[](symbol){Last}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){data}<LSEP>[](symbol){following}<LEND>[call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){data}<LSEP>[](symbol){mode}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){data}<LSEP>[](symbol){following}<LEND>[call](){}<LSEP>[](symbol){write.csv}<LSEP>[](symbol){submission}<LSEP>[argument 1; litteral](str){Frequencies.csv}<LSEP>[argument 2; litteral](logical){FALSE} |
[](){expression}<LSEP>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){data.table}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){FeatureHashing}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){xgboost}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){dplyr}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){Matrix}<LEND>[call](){}<LSEP>[](symbol){cat}<LEND>[argument 0; call](){}<LSEP>[](symbol){Sys.time}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){Reading data\n}<LEND>[assign](){=}<LSEP>[](symbol){train}<LEND>[call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){fread}<LSEP>[argument 0; litteral](str){../input/act_train.csv}<LSEP>[argument 1; litteral](logical){FALSE}<LEND>[argument 1; call](){}<LSEP>[](symbol){as.data.frame}<LEND>[assign](){=}<LSEP>[](symbol){test}<LEND>[call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){fread}<LSEP>[argument 0; litteral](str){../input/act_test.csv}<LSEP>[argument 1; litteral](logical){FALSE}<LEND>[argument 1; call](){}<LSEP>[](symbol){as.data.frame}<LEND>[assign](){=}<LSEP>[](symbol){people}<LEND>[call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){fread}<LSEP>[argument 0; litteral](str){../input/people.csv}<LEND>[argument 1; call](){}<LSEP>[](symbol){as.data.frame}<LEND>[call](){}<LSEP>[](symbol){cat}<LEND>[argument 0; call](){}<LSEP>[](symbol){Sys.time}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){Processing data\n}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){people}<LSEP>[](symbol){char_1}<LEND>[litteral](NULL){NULL}<LEND>[assign](){=}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){names}<LSEP>[](symbol){people}<LEND>[argument 1; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){2.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){length}<LEND>[argument 0; call](){}<LSEP>[](symbol){names}<LSEP>[](symbol){people}<LEND>[call](){}<LSEP>[](symbol){paste0}<LSEP>[argument 0; litteral](str){people_}<LEND>[argument 1; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){names}<LSEP>[](symbol){people}<LEND>[argument 1; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){2.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){length}<LEND>[argument 0; call](){}<LSEP>[](symbol){names}<LSEP>[](symbol){people}<LEND>[assign](){<-}<LSEP>[](symbol){p_logi}<LEND>[call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){names}<LSEP>[](symbol){people}<LEND>[argument 1; call](){}<LSEP>[](symbol){which}<LEND>[argument 0; call](){}<LSEP>[](symbol){sapply}<LSEP>[](symbol){people}<LSEP>[](symbol){is.logical}<LEND>[control flow](){for}<LSEP>[](symbol){col}<LSEP>[](symbol){p_logi}<LEND>[body; call](){}<LSEP>[](symbol){set}<LSEP>[](symbol){people}<LSEP>[](symbol){col}<LEND>[argument 2; call](){}<LSEP>[](symbol){as.numeric}<LEND>[argument 0; call](){}<LSEP>[](symbol){[[}<LSEP>[](symbol){people}<LSEP>[](symbol){col}<LEND>[assign](){=}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){people}<LSEP>[](symbol){people_group_1}<LEND>[argument 1; call](){}<LSEP>[](symbol){%in%}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){people}<LSEP>[](symbol){people_group_1}<LEND>[argument 1; call](){}<LSEP>[](symbol){names}<LEND>[argument 0; call](){}<LSEP>[](symbol){which}<LEND>[argument 0; call](){}<LSEP>[](symbol){==}<LEND>[argument 0; call](){}<LSEP>[](symbol){table}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){people}<LSEP>[](symbol){people_group_1}<LEND>[argument 1; litteral](real){1.000000}<LEND>[litteral](str){group unique}<LEND>[assign](){<-}<LSEP>[](symbol){d1}<LEND>[call](){}<LSEP>[](symbol){merge}<LSEP>[](symbol){train}<LSEP>[](symbol){people}<LSEP>[argument 2; litteral](str){people_id}<LSEP>[](symbol){T}<LEND>[assign](){<-}<LSEP>[](symbol){d2}<LEND>[call](){}<LSEP>[](symbol){merge}<LSEP>[](symbol){test}<LSEP>[](symbol){people}<LSEP>[argument 2; litteral](str){people_id}<LSEP>[](symbol){T}<LEND>[assign](){<-}<LSEP>[](symbol){Y}<LEND>[call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){d1}<LSEP>[](symbol){outcome}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){d1}<LSEP>[](symbol){outcome}<LEND>[litteral](NULL){NULL}<LEND>[assign](){=}<LSEP>[](symbol){row.train}<LEND>[call](){}<LSEP>[](symbol){nrow}<LSEP>[](symbol){train}<LEND>[call](){}<LSEP>[](symbol){gc}<LSEP>[argument 0; litteral](logical){FALSE}<LEND>[assign](){=}<LSEP>[](symbol){D}<LEND>[call](){}<LSEP>[](symbol){rbind}<LSEP>[](symbol){d1}<LSEP>[](symbol){d2}<LEND>[assign](){=}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){i}<LEND>[call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){dim}<LSEP>[](symbol){D}<LEND>[argument 1; litteral](real){1.000000}<LEND>[assign](){=}<LSEP>[](symbol){test_activity_id}<LEND>[call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){test}<LSEP>[](symbol){activity_id}<LEND>[call](){}<LSEP>[](symbol){rm}<LSEP>[](symbol){train}<LSEP>[](symbol){test}<LSEP>[](symbol){d1}<LSEP>[](symbol){d2}<LEND>[call](){}<LSEP>[](symbol){gc}<LSEP>[argument 0; litteral](logical){FALSE}<LEND>[assign](){=}<LSEP>[](symbol){char.cols}<LEND>[call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){activity_category}<LSEP>[argument 1; litteral](str){people_group_1}<LSEP>[argument 2; litteral](str){char_1}<LSEP>[argument 3; litteral](str){char_2}<LSEP>[argument 4; litteral](str){char_3}<LSEP>[argument 5; litteral](str){char_4}<LSEP>[argument 6; litteral](str){char_5}<LSEP>[argument 7; litteral](str){char_6}<LSEP>[argument 8; litteral](str){char_7}<LSEP>[argument 9; litteral](str){char_8}<LSEP>[argument 10; litteral](str){char_9}<LSEP>[argument 11; litteral](str){char_10}<LSEP>[argument 12; litteral](str){people_char_2}<LSEP>[argument 13; litteral](str){people_char_3}<LSEP>[argument 14; litteral](str){people_char_4}<LSEP>[argument 15; litteral](str){people_char_5}<LSEP>[argument 16; litteral](str){people_char_6}<LSEP>[argument 17; litteral](str){people_char_7}<LSEP>[argument 18; litteral](str){people_char_8}<LSEP>[argument 19; litteral](str){people_char_9}<LEND>[control flow](){for}<LSEP>[](symbol){f}<LSEP>[](symbol){char.cols}<LEND>[body; block](){}<LSEP>[statement 0; control flow](){if}<LSEP>[condition; call](){}<LSEP>[](symbol){==}<LEND>[argument 0; call](){}<LSEP>[](symbol){class}<LEND>[argument 0; call](){}<LSEP>[](symbol){[[}<LSEP>[](symbol){D}<LSEP>[](symbol){f}<LEND>[argument 1; litteral](str){character}<LEND>[true branch; block](){}<LSEP>[statement 0; assign](){<-}<LSEP>[](symbol){levels}<LEND>[call](){}<LSEP>[](symbol){unique}<LEND>[argument 0; call](){}<LSEP>[](symbol){c}<LEND>[argument 0; call](){}<LSEP>[](symbol){[[}<LSEP>[](symbol){D}<LSEP>[](symbol){f}<LEND>[statement 1; assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[[}<LSEP>[](symbol){D}<LSEP>[](symbol){f}<LEND>[call](){}<LSEP>[](symbol){as.numeric}<LEND>[argument 0; call](){}<LSEP>[](symbol){factor}<LEND>[argument 0; call](){}<LSEP>[](symbol){[[}<LSEP>[](symbol){D}<LSEP>[](symbol){f}<LEND>[](symbol){levels}<LEND>[call](){}<LSEP>[](symbol){cat}<LEND>[argument 0; call](){}<LSEP>[](symbol){Sys.time}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){Making sparse data (1)\n}<LEND>[assign](){=}<LSEP>[](symbol){D.sparse}<LEND>[call](){}<LSEP>[](symbol){cBind}<LEND>[argument 0; call](){}<LSEP>[](symbol){sparseMatrix}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){i}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){activity_category}<LEND>[argument 1; call](){}<LSEP>[](symbol){sparseMatrix}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){i}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_group_1}<LEND>[argument 2; call](){}<LSEP>[](symbol){sparseMatrix}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){i}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){char_1}<LEND>[argument 3; call](){}<LSEP>[](symbol){sparseMatrix}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){i}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){char_2}<LEND>[argument 4; call](){}<LSEP>[](symbol){sparseMatrix}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){i}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){char_3}<LEND>[argument 5; call](){}<LSEP>[](symbol){sparseMatrix}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){i}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){char_4}<LEND>[argument 6; call](){}<LSEP>[](symbol){sparseMatrix}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){i}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){char_5}<LEND>[argument 7; call](){}<LSEP>[](symbol){sparseMatrix}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){i}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){char_6}<LEND>[argument 8; call](){}<LSEP>[](symbol){sparseMatrix}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){i}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){char_7}<LEND>[argument 9; call](){}<LSEP>[](symbol){sparseMatrix}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){i}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){char_8}<LEND>[argument 10; call](){}<LSEP>[](symbol){sparseMatrix}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){i}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){char_9}<LEND>[argument 11; call](){}<LSEP>[](symbol){sparseMatrix}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){i}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_2}<LEND>[argument 12; call](){}<LSEP>[](symbol){sparseMatrix}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){i}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_3}<LEND>[argument 13; call](){}<LSEP>[](symbol){sparseMatrix}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){i}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_4}<LEND>[argument 14; call](){}<LSEP>[](symbol){sparseMatrix}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){i}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_5}<LEND>[argument 15; call](){}<LSEP>[](symbol){sparseMatrix}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){i}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_6}<LEND>[argument 16; call](){}<LSEP>[](symbol){sparseMatrix}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){i}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_7}<LEND>[argument 17; call](){}<LSEP>[](symbol){sparseMatrix}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){i}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_8}<LEND>[argument 18; call](){}<LSEP>[](symbol){sparseMatrix}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){i}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_9}<LEND>[call](){}<LSEP>[](symbol){cat}<LEND>[argument 0; call](){}<LSEP>[](symbol){Sys.time}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){Making sparse data (2)\n}<LEND>[assign](){=}<LSEP>[](symbol){D.sparse}<LEND>[call](){}<LSEP>[](symbol){cBind}<LSEP>[](symbol){D.sparse}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_10}<LEND>[argument 2; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_11}<LEND>[argument 3; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_12}<LEND>[argument 4; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_13}<LEND>[argument 5; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_14}<LEND>[argument 6; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_15}<LEND>[argument 7; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_16}<LEND>[argument 8; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_17}<LEND>[argument 9; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_18}<LEND>[argument 10; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_19}<LEND>[argument 11; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_20}<LEND>[argument 12; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_21}<LEND>[argument 13; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_22}<LEND>[argument 14; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_23}<LEND>[argument 15; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_24}<LEND>[argument 16; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_25}<LEND>[argument 17; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_26}<LEND>[argument 18; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_27}<LEND>[argument 19; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_28}<LEND>[argument 20; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_29}<LEND>[argument 21; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_30}<LEND>[argument 22; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_31}<LEND>[argument 23; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_32}<LEND>[argument 24; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_33}<LEND>[argument 25; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_34}<LEND>[argument 26; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_35}<LEND>[argument 27; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_36}<LEND>[argument 28; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_37}<LEND>[argument 29; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){D}<LSEP>[](symbol){people_char_38}<LEND>[call](){}<LSEP>[](symbol){cat}<LEND>[argument 0; call](){}<LSEP>[](symbol){Sys.time}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){Unmerging train/test sparse da...}<LEND>[assign](){=}<LSEP>[](symbol){train.sparse}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){D.sparse}<LEND>[argument 1; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){1.000000}<LSEP>[](symbol){row.train}<LEND>[](symbol){}<LEND>[assign](){=}<LSEP>[](symbol){test.sparse}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){D.sparse}<LEND>[argument 1; call](){}<LSEP>[](symbol){:}<LEND>[argument 0; call](){}<LSEP>[](symbol){(}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LSEP>[](symbol){row.train}<LSEP>[argument 1; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){nrow}<LSEP>[](symbol){D.sparse}<LEND>[](symbol){}<LEND>[call](){}<LSEP>[](symbol){cat}<LEND>[argument 0; call](){}<LSEP>[](symbol){Sys.time}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){Making data for SVMLight format\n}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){Creating SVMLight format\n}<LEND>[assign](){<-}<LSEP>[](symbol){dtrain}<LEND>[call](){}<LSEP>[](symbol){xgb.DMatrix}<LSEP>[](symbol){train.sparse}<LSEP>[](symbol){Y}<LEND>[call](){}<LSEP>[](symbol){gc}<LSEP>[argument 0; litteral](logical){FALSE}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){Exporting SVMLight format\n}<LEND>[call](){}<LSEP>[](symbol){xgb.DMatrix.save}<LSEP>[](symbol){dtrain}<LSEP>[argument 1; litteral](str){dtrain.data}<LEND>[call](){}<LSEP>[](symbol){gc}<LSEP>[argument 0; litteral](logical){FALSE}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){Zipping SVMLight\n}<LEND>[call](){}<LSEP>[](symbol){zip}<LSEP>[argument 0; litteral](str){dtrain.data.zip}<LSEP>[argument 1; litteral](str){dtrain.data}<LSEP>[argument 2; litteral](str){-m9X}<LSEP>[argument 3; litteral](str){}<LEND>[argument 4; call](){}<LSEP>[](symbol){Sys.getenv}<LSEP>[argument 0; litteral](str){R_ZIPCMD}<LSEP>[argument 1; litteral](str){zip}<LEND>[call](){}<LSEP>[](symbol){cat}<LEND>[argument 0; call](){}<LSEP>[](symbol){Sys.time}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){File size of train in SVMLight: }<LEND>[argument 1; call](){}<LSEP>[](symbol){file.size}<LSEP>[argument 0; litteral](str){dtrain.data.zip}<LEND>[argument 2; litteral](str){\n}<LSEP>[argument 3; litteral](str){}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){Creating SVMLight format\n}<LEND>[assign](){<-}<LSEP>[](symbol){dtest}<LEND>[call](){}<LSEP>[](symbol){xgb.DMatrix}<LSEP>[](symbol){test.sparse}<LEND>[call](){}<LSEP>[](symbol){gc}<LSEP>[argument 0; litteral](logical){FALSE}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){Exporting SVMLight format\n}<LEND>[call](){}<LSEP>[](symbol){xgb.DMatrix.save}<LSEP>[](symbol){dtest}<LSEP>[argument 1; litteral](str){dtest.data}<LEND>[call](){}<LSEP>[](symbol){gc}<LSEP>[argument 0; litteral](logical){FALSE}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){Zipping SVMLight\n}<LEND>[call](){}<LSEP>[](symbol){zip}<LSEP>[argument 0; litteral](str){dtest.data.zip}<LSEP>[argument 1; litteral](str){dtest.data}<LSEP>[argument 2; litteral](str){-m9X}<LSEP>[argument 3; litteral](str){}<LEND>[argument 4; call](){}<LSEP>[](symbol){Sys.getenv}<LSEP>[argument 0; litteral](str){R_ZIPCMD}<LSEP>[argument 1; litteral](str){zip}<LEND>[call](){}<LSEP>[](symbol){cat}<LEND>[argument 0; call](){}<LSEP>[](symbol){Sys.time}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){File size of test in SVMLight: }<LEND>[argument 1; call](){}<LSEP>[](symbol){file.size}<LSEP>[argument 0; litteral](str){dtest.data.zip}<LEND>[argument 2; litteral](str){\n}<LSEP>[argument 3; litteral](str){}<LEND>[call](){}<LSEP>[](symbol){gc}<LSEP>[argument 0; litteral](logical){FALSE}<LEND>[assign](){<-}<LSEP>[](symbol){param}<LEND>[call](){}<LSEP>[](symbol){list}<LSEP>[argument 0; litteral](str){binary:logistic}<LSEP>[argument 1; litteral](str){auc}<LSEP>[argument 2; litteral](str){gbtree}<LSEP>[argument 3; litteral](real){0.050000}<LSEP>[argument 4; litteral](real){0.860000}<LSEP>[argument 5; litteral](real){0.920000}<LSEP>[argument 6; litteral](real){0.900000}<LSEP>[argument 7; litteral](real){0.000000}<LSEP>[argument 8; litteral](real){0.005000}<LSEP>[argument 9; litteral](real){11.000000}<LEND>[call](){}<LSEP>[](symbol){cat}<LEND>[argument 0; call](){}<LSEP>[](symbol){Sys.time}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){XGBoost\n}<LEND>[call](){}<LSEP>[](symbol){set.seed}<LSEP>[argument 0; litteral](real){1712.000000}<LEND>[assign](){<-}<LSEP>[](symbol){m2}<LEND>[call](){}<LSEP>[](symbol){xgb.train}<LSEP>[](symbol){dtrain}<LSEP>[](symbol){param}<LSEP>[argument 2; litteral](real){550.000000}<LEND>[argument 3; call](){}<LSEP>[](symbol){list}<LSEP>[](symbol){dtrain}<LEND>[argument 4; litteral](real){10.000000}<LEND>[call](){}<LSEP>[](symbol){cat}<LEND>[argument 0; call](){}<LSEP>[](symbol){Sys.time}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){Predicting on test data\n}<LEND>[assign](){<-}<LSEP>[](symbol){out}<LEND>[call](){}<LSEP>[](symbol){predict}<LSEP>[](symbol){m2}<LSEP>[](symbol){dtest}<LEND>[assign](){<-}<LSEP>[](symbol){sub}<LEND>[call](){}<LSEP>[](symbol){data.frame}<LSEP>[](symbol){test_activity_id}<LSEP>[](symbol){out}<LEND>[call](){}<LSEP>[](symbol){write.csv}<LSEP>[](symbol){sub}<LSEP>[argument 1; litteral](str){model_sub.csv}<LSEP>[](symbol){F}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){Cleaning up...\n}<LEND>[call](){}<LSEP>[](symbol){remove}<LEND>[argument 0; call](){}<LSEP>[](symbol){ls}<LEND>[call](){}<LSEP>[](symbol){gc}<LSEP>[argument 0; litteral](logical){FALSE}<LEND>[call](){}<LSEP>[](symbol){cat}<LEND>[argument 0; call](){}<LSEP>[](symbol){Sys.time}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){Doing Loiso's magic leak\n}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){Working on people\n}<LEND>[assign](){<-}<LSEP>[](symbol){ppl}<LEND>[call](){}<LSEP>[](symbol){fread}<LSEP>[argument 0; litteral](str){../input/people.csv}<LEND>[assign](){<-}<LSEP>[](symbol){p_logi}<LEND>[call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){names}<LSEP>[](symbol){ppl}<LEND>[argument 1; call](){}<LSEP>[](symbol){which}<LEND>[argument 0; call](){}<LSEP>[](symbol){sapply}<LSEP>[](symbol){ppl}<LSEP>[](symbol){is.logical}<LEND>[control flow](){for}<LSEP>[](symbol){col}<LSEP>[](symbol){p_logi}<LEND>[body; block](){}<LSEP>[statement 0; call](){}<LSEP>[](symbol){set}<LSEP>[](symbol){ppl}<LSEP>[](symbol){col}<LEND>[argument 2; call](){}<LSEP>[](symbol){as.numeric}<LEND>[argument 0; call](){}<LSEP>[](symbol){[[}<LSEP>[](symbol){ppl}<LSEP>[](symbol){col}<LEND>[call](){}<LSEP>[](symbol){rm}<LSEP>[](symbol){p_logi}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){ppl}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){:=}<LSEP>[](symbol){date}<LEND>[argument 1; call](){}<LSEP>[](symbol){as.Date}<LEND>[argument 0; call](){}<LSEP>[](symbol){as.character}<LSEP>[](symbol){date}<LEND>[argument 1; litteral](str){%Y-%m-%d}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){Working on data\n}<LEND>[assign](){<-}<LSEP>[](symbol){activs}<LEND>[call](){}<LSEP>[](symbol){fread}<LSEP>[argument 0; litteral](str){../input/act_train.csv}<LEND>[assign](){<-}<LSEP>[](symbol){TestActivs}<LEND>[call](){}<LSEP>[](symbol){fread}<LSEP>[argument 0; litteral](str){../input/act_test.csv}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){TestActivs}<LSEP>[](symbol){outcome}<LEND>[litteral](logical){NA}<LEND>[assign](){<-}<LSEP>[](symbol){activs}<LEND>[call](){}<LSEP>[](symbol){rbind}<LSEP>[](symbol){activs}<LSEP>[](symbol){TestActivs}<LEND>[call](){}<LSEP>[](symbol){rm}<LSEP>[](symbol){TestActivs}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){Merging\n}<LEND>[assign](){<-}<LSEP>[](symbol){activs}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){activs}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){people_id}<LSEP>[argument 1; litteral](str){outcome}<LSEP>[argument 2; litteral](str){activity_id}<LSEP>[argument 3; litteral](str){date}<LEND>[](symbol){F}<LEND>[assign](){<-}<LSEP>[](symbol){d1}<LEND>[call](){}<LSEP>[](symbol){merge}<LSEP>[](symbol){activs}<LSEP>[](symbol){ppl}<LSEP>[argument 2; litteral](str){people_id}<LSEP>[](symbol){T}<LEND>[assign](){<-}<LSEP>[](symbol){testset}<LEND>[call](){}<LSEP>[](symbol){which}<LEND>[argument 0; call](){}<LSEP>[](symbol){%in%}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){ppl}<LSEP>[](symbol){people_id}<LEND>[argument 1; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){d1}<LSEP>[](symbol){people_id}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){d1}<LSEP>[](symbol){outcome}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){d1}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){:=}<LSEP>[](symbol){activdate}<LEND>[argument 1; call](){}<LSEP>[](symbol){as.Date}<LEND>[argument 0; call](){}<LSEP>[](symbol){as.character}<LSEP>[](symbol){date.x}<LEND>[argument 1; litteral](str){%Y-%m-%d}<LEND>[call](){}<LSEP>[](symbol){rm}<LSEP>[](symbol){activs}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){Creating interaction\n}<LEND>[assign](){<-}<LSEP>[](symbol){minactivdate}<LEND>[call](){}<LSEP>[](symbol){min}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){d1}<LSEP>[](symbol){activdate}<LEND>[assign](){<-}<LSEP>[](symbol){maxactivdate}<LEND>[call](){}<LSEP>[](symbol){max}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){d1}<LSEP>[](symbol){activdate}<LEND>[assign](){<-}<LSEP>[](symbol){alldays}<LEND>[call](){}<LSEP>[](symbol){seq}<LSEP>[](symbol){minactivdate}<LSEP>[](symbol){maxactivdate}<LSEP>[argument 2; litteral](str){day}<LEND>[assign](){<-}<LSEP>[](symbol){allCompaniesAndDays}<LEND>[call](){}<LSEP>[](symbol){data.table}<LEND>[argument 0; call](){}<LSEP>[](symbol){expand.grid}<LEND>[argument 0; call](){}<LSEP>[](symbol){unique}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){d1}<LSEP>[](symbol){group_1}<LEND>[argument 1; call](){}<LSEP>[](symbol){!}<LEND>[argument 0; call](){}<LSEP>[](symbol){%in%}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){d1}<LSEP>[](symbol){people_id}<LEND>[argument 1; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){ppl}<LSEP>[](symbol){people_id}<LEND>[](symbol){testset}<LEND>[](symbol){alldays}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){colnames}<LSEP>[](symbol){allCompaniesAndDays}<LEND>[call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){group_1}<LSEP>[argument 1; litteral](str){date.p}<LEND>[call](){}<LSEP>[](symbol){setkey}<LSEP>[](symbol){allCompaniesAndDays}<LSEP>[argument 1; litteral](str){group_1}<LSEP>[argument 2; litteral](str){date.p}<LEND>[assign](){<-}<LSEP>[](symbol){meanbycomdate}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){d1}<LEND>[argument 1; call](){}<LSEP>[](symbol){!}<LEND>[argument 0; call](){}<LSEP>[](symbol){%in%}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){d1}<LSEP>[](symbol){people_id}<LEND>[argument 1; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){ppl}<LSEP>[](symbol){people_id}<LEND>[](symbol){testset}<LEND>[argument 2; call](){}<LSEP>[](symbol){mean}<LSEP>[](symbol){outcome}<LEND>[argument 3; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){group_1}<LSEP>[argument 1; litteral](str){activdate}<LEND>[assign](){<-}<LSEP>[](symbol){allCompaniesAndDays}<LEND>[call](){}<LSEP>[](symbol){merge}<LSEP>[](symbol){allCompaniesAndDays}<LSEP>[](symbol){meanbycomdate}<LEND>[argument 2; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){group_1}<LSEP>[argument 1; litteral](str){date.p}<LEND>[argument 3; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){group_1}<LSEP>[argument 1; litteral](str){activdate}<LEND>[](symbol){T}<LEND>[assign](){<-}<LSEP>[](symbol){interpolateFun}<LEND>[](){function}<LSEP>[](pairlist){}<LSEP>[](symbol){x}<LEND>[body; block](){}<LSEP>[statement 0; assign](){<-}<LSEP>[](symbol){borders}<LEND>[call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){which}<LEND>[argument 0; call](){}<LSEP>[](symbol){!}<LEND>[argument 0; call](){}<LSEP>[](symbol){is.na}<LSEP>[](symbol){x}<LEND>[argument 2; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){length}<LSEP>[](symbol){x}<LEND>[argument 1; litteral](real){1.000000}<LEND>[statement 1; assign](){<-}<LSEP>[](symbol){forward_border}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){borders}<LEND>[argument 1; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){2.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){length}<LSEP>[](symbol){borders}<LEND>[statement 2; assign](){<-}<LSEP>[](symbol){backward_border}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){borders}<LEND>[argument 1; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){(}<LEND>[argument 0; call](){}<LSEP>[](symbol){-}<LEND>[argument 0; call](){}<LSEP>[](symbol){length}<LSEP>[](symbol){borders}<LEND>[argument 1; litteral](real){1.000000}<LEND>[statement 3; assign](){<-}<LSEP>[](symbol){forward_border_x}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){x}<LSEP>[](symbol){forward_border}<LEND>[statement 4; assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){forward_border_x}<LEND>[argument 1; call](){}<LSEP>[](symbol){length}<LSEP>[](symbol){forward_border_x}<LEND>[call](){}<LSEP>[](symbol){abs}<LEND>[argument 0; call](){}<LSEP>[](symbol){-}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){forward_border_x}<LEND>[argument 1; call](){}<LSEP>[](symbol){-}<LEND>[argument 0; call](){}<LSEP>[](symbol){length}<LSEP>[](symbol){forward_border_x}<LEND>[argument 1; litteral](real){1.000000}<LEND>[argument 1; litteral](real){0.200000}<LEND>[statement 5; assign](){<-}<LSEP>[](symbol){backward_border_x}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){x}<LSEP>[](symbol){backward_border}<LEND>[statement 6; assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){backward_border_x}<LSEP>[argument 1; litteral](real){1.000000}<LEND>[call](){}<LSEP>[](symbol){abs}<LEND>[argument 0; call](){}<LSEP>[](symbol){-}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){forward_border_x}<LSEP>[argument 1; litteral](real){1.000000}<LEND>[argument 1; litteral](real){0.100000}<LEND>[statement 7; assign](){<-}<LSEP>[](symbol){forward_x_fill}<LEND>[call](){}<LSEP>[](symbol){rep}<LSEP>[](symbol){forward_border_x}<LEND>[argument 1; call](){}<LSEP>[](symbol){-}<LSEP>[](symbol){forward_border}<LSEP>[](symbol){backward_border}<LEND>[statement 8; assign](){<-}<LSEP>[](symbol){backward_x_fill}<LEND>[call](){}<LSEP>[](symbol){rep}<LSEP>[](symbol){backward_border_x}<LEND>[argument 1; call](){}<LSEP>[](symbol){-}<LSEP>[](symbol){forward_border}<LSEP>[](symbol){backward_border}<LEND>[statement 9; assign](){<-}<LSEP>[](symbol){forward_x_fill_2}<LEND>[call](){}<LSEP>[](symbol){-}<LEND>[argument 0; call](){}<LSEP>[](symbol){rep}<LSEP>[](symbol){forward_border}<LEND>[argument 1; call](){}<LSEP>[](symbol){-}<LSEP>[](symbol){forward_border}<LSEP>[](symbol){backward_border}<LEND>[argument 1; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){length}<LSEP>[](symbol){forward_x_fill}<LEND>[statement 10; assign](){<-}<LSEP>[](symbol){backward_x_fill_2}<LEND>[call](){}<LSEP>[](symbol){-}<LEND>[argument 0; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){length}<LSEP>[](symbol){forward_x_fill}<LEND>[argument 1; call](){}<LSEP>[](symbol){rep}<LSEP>[](symbol){backward_border}<LEND>[argument 1; call](){}<LSEP>[](symbol){-}<LSEP>[](symbol){forward_border}<LSEP>[](symbol){backward_border}<LEND>[statement 11; assign](){<-}<LSEP>[](symbol){vec}<LEND>[call](){}<LSEP>[](symbol){/}<LEND>[argument 0; call](){}<LSEP>[](symbol){(}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LSEP>[](symbol){forward_x_fill}<LSEP>[](symbol){backward_x_fill}<LEND>[argument 1; litteral](real){2.000000}<LEND>[statement 12; assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){x}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LSEP>[](symbol){x}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){vec}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LSEP>[](symbol){x}<LEND>[statement 13; call](){}<LSEP>[](symbol){return}<LSEP>[](symbol){x}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){Applying interaction interpola...}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){allCompaniesAndDays}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){:=}<LSEP>[](symbol){filled}<LEND>[argument 1; call](){}<LSEP>[](symbol){interpolateFun}<LSEP>[](symbol){V1}<LEND>[argument 3; litteral](str){group_1}<LEND>[assign](){<-}<LSEP>[](symbol){d1}<LEND>[call](){}<LSEP>[](symbol){merge}<LSEP>[](symbol){d1}<LSEP>[](symbol){allCompaniesAndDays}<LSEP>[](symbol){T}<LSEP>[](symbol){F}<LEND>[argument 4; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){group_1}<LSEP>[argument 1; litteral](str){activdate}<LEND>[argument 5; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){group_1}<LSEP>[argument 1; litteral](str){date.p}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){Predicting leak\n}<LEND>[assign](){<-}<LSEP>[](symbol){testsetdt}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){d1}<LEND>[argument 1; call](){}<LSEP>[](symbol){%in%}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){d1}<LSEP>[](symbol){people_id}<LEND>[argument 1; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){ppl}<LSEP>[](symbol){people_id}<LEND>[](symbol){testset}<LEND>[argument 2; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){activity_id}<LSEP>[argument 1; litteral](str){filled}<LEND>[](symbol){F}<LEND>[call](){}<LSEP>[](symbol){write.csv}<LSEP>[](symbol){testsetdt}<LSEP>[argument 1; litteral](str){Submission.csv}<LSEP>[argument 2; litteral](logical){FALSE}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){Cleaning up...\n}<LEND>[call](){}<LSEP>[](symbol){remove}<LEND>[argument 0; call](){}<LSEP>[](symbol){ls}<LEND>[call](){}<LSEP>[](symbol){gc}<LSEP>[argument 0; litteral](logical){FALSE}<LEND>[call](){}<LSEP>[](symbol){cat}<LEND>[argument 0; call](){}<LSEP>[](symbol){Sys.time}<LEND>[call](){}<LSEP>[](symbol){cat}<LSEP>[argument 0; litteral](str){Combining two submissions on t...}<LEND>[assign](){<-}<LSEP>[](symbol){submit1}<LEND>[call](){}<LSEP>[](symbol){fread}<LSEP>[argument 0; litteral](str){Submission.csv}<LEND>[assign](){<-}<LSEP>[](symbol){submit2}<LEND>[call](){}<LSEP>[](symbol){fread}<LSEP>[argument 0; litteral](str){model_sub.csv}<LEND>[assign](){<-}<LSEP>[](symbol){submit3}<LEND>[call](){}<LSEP>[](symbol){merge}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){submit1}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){submit1}<LSEP>[](symbol){filled}<LEND>[](symbol){}<LEND>[](symbol){submit2}<LSEP>[argument 2; litteral](str){activity_id}<LSEP>[](symbol){T}<LEND>[assign](){<-}<LSEP>[](symbol){submit4}<LEND>[call](){}<LSEP>[](symbol){merge}<LSEP>[](symbol){submit1}<LSEP>[](symbol){submit3}<LSEP>[argument 2; litteral](str){activity_id}<LSEP>[](symbol){T}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){submit4}<LSEP>[](symbol){filled.x}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){submit4}<LSEP>[](symbol){filled.x}<LEND>[call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){submit4}<LSEP>[](symbol){outcome}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){submit4}<LSEP>[](symbol){filled.x}<LEND>[assign](){<-}<LSEP>[](symbol){submit5}<LEND>[call](){}<LSEP>[](symbol){data.frame}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){submit4}<LSEP>[](symbol){activity_id}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){submit4}<LSEP>[](symbol){filled.x}<LEND>[argument 2; litteral](logical){FALSE}<LEND>[call](){}<LSEP>[](symbol){write.csv}<LSEP>[](symbol){submit5}<LSEP>[argument 1; litteral](str){mod3108Kaggle_01.csv}<LSEP>[argument 2; litteral](logical){FALSE} |
[](){expression}<LSEP>[assign](){<-}<LSEP>[](symbol){train}<LEND>[call](){}<LSEP>[](symbol){read.csv}<LSEP>[argument 0; litteral](str){../input/train.csv}<LSEP>[argument 1; litteral](logical){TRUE}<LEND>[assign](){<-}<LSEP>[](symbol){test}<LEND>[call](){}<LSEP>[](symbol){read.csv}<LSEP>[argument 0; litteral](str){../input/test.csv}<LSEP>[argument 1; litteral](logical){TRUE}<LEND>[call](){}<LSEP>[](symbol){cat}<LEND>[argument 0; call](){}<LSEP>[](symbol){sprintf}<LSEP>[argument 0; litteral](str){Training set has %d rows and %...}<LEND>[argument 1; call](){}<LSEP>[](symbol){nrow}<LSEP>[](symbol){train}<LEND>[argument 2; call](){}<LSEP>[](symbol){ncol}<LSEP>[](symbol){train}<LEND>[call](){}<LSEP>[](symbol){cat}<LEND>[argument 0; call](){}<LSEP>[](symbol){sprintf}<LSEP>[argument 0; litteral](str){Test set has %d rows and %d co...}<LEND>[argument 1; call](){}<LSEP>[](symbol){nrow}<LSEP>[](symbol){test}<LEND>[argument 2; call](){}<LSEP>[](symbol){ncol}<LSEP>[](symbol){test}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){rownames}<LSEP>[](symbol){train}<LEND>[call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){Id}<LEND>[assign](){<-}<LSEP>[](symbol){train}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){train}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){-}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[assign](){=}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){Hazard}<LEND>[call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){log}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){Hazard}<LEND>[argument 1; litteral](real){1.000000}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){mlr}<LEND>[call](){}<LSEP>[](symbol){configureMlr}<LSEP>[argument 0; litteral](logical){FALSE}<LSEP>[argument 1; litteral](str){warn}<LEND>[assign](){=}<LSEP>[](symbol){GBM}<LEND>[call](){}<LSEP>[](symbol){makeLearner}<LSEP>[argument 0; litteral](str){regr.gbm}<LEND>[argument 1; call](){}<LSEP>[](symbol){list}<LSEP>[argument 0; litteral](real){700.000000}<LSEP>[argument 1; litteral](str){laplace}<LSEP>[argument 2; litteral](integer){20}<LEND>[assign](){=}<LSEP>[](symbol){GBM}<LEND>[call](){}<LSEP>[](symbol){makeDownsampleWrapper}<LSEP>[](symbol){GBM}<LSEP>[argument 1; litteral](real){0.200000}<LEND>[assign](){=}<LSEP>[](symbol){RF}<LEND>[call](){}<LSEP>[](symbol){makeLearner}<LSEP>[argument 0; litteral](str){regr.randomForest}<LEND>[assign](){=}<LSEP>[](symbol){RF}<LEND>[call](){}<LSEP>[](symbol){makeDownsampleWrapper}<LSEP>[](symbol){RF}<LSEP>[argument 1; litteral](real){0.200000}<LEND>[assign](){=}<LSEP>[](symbol){STACK}<LEND>[call](){}<LSEP>[](symbol){makeStackedLearner}<LEND>[argument 0; call](){}<LSEP>[](symbol){list}<LSEP>[](symbol){GBM}<LSEP>[](symbol){RF}<LEND>[argument 1; litteral](str){regr.gbm}<LSEP>[argument 2; litteral](str){stack.cv}<LEND>[assign](){=}<LSEP>[](symbol){TASK}<LEND>[call](){}<LSEP>[](symbol){makeRegrTask}<LSEP>[argument 0; litteral](str){Property Inspection Prediction}<LSEP>[](symbol){train}<LSEP>[argument 2; litteral](str){Hazard}<LEND>[call](){}<LSEP>[](symbol){removeConstantFeatures}<LSEP>[](symbol){TASK}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){parallelMap}<LEND>[call](){}<LSEP>[](symbol){parallelStartMulticore}<LEND>[assign](){=}<LSEP>[](symbol){fitted}<LEND>[call](){}<LSEP>[](symbol){train}<LSEP>[](symbol){STACK}<LSEP>[](symbol){TASK}<LEND>[call](){}<LSEP>[](symbol){parallelStop}<LEND>[assign](){=}<LSEP>[](symbol){submit}<LEND>[call](){}<LSEP>[](symbol){predict}<LSEP>[](symbol){fitted}<LSEP>[](symbol){test}<LEND>[assign](){=}<LSEP>[](symbol){submit}<LEND>[call](){}<LSEP>[](symbol){exp}<LEND>[argument 0; call](){}<LSEP>[](symbol){-}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){submit}<LSEP>[](symbol){data}<LEND>[](symbol){response}<LEND>[argument 1; litteral](real){1.000000}<LEND>[assign](){=}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){submit}<LEND>[argument 1; call](){}<LSEP>[](symbol){<}<LSEP>[](symbol){submit}<LSEP>[argument 1; litteral](real){1.000000}<LEND>[litteral](real){1.000000}<LEND>[call](){}<LSEP>[](symbol){print}<LEND>[argument 0; call](){}<LSEP>[](symbol){head}<LSEP>[](symbol){submit}<LEND>[call](){}<LSEP>[](symbol){write.csv}<LEND>[argument 0; call](){}<LSEP>[](symbol){data.frame}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){test}<LSEP>[](symbol){Id}<LEND>[](symbol){submit}<LEND>[argument 1; litteral](str){PIP_MLR.csv}<LSEP>[](symbol){F}<LSEP>[argument 3; litteral](logical){FALSE} |
[](){expression}<LSEP>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){ggplot2}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){readr}<LEND>[call](){}<LSEP>[](symbol){system}<LSEP>[argument 0; litteral](str){ls ../input} |
[](){expression}<LSEP>[call](){}<LSEP>[](symbol){rm}<LEND>[argument 0; call](){}<LSEP>[](symbol){ls}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){ggplot2}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){readr}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){stringr}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){tm}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){syuzhet}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){SnowballC}<LEND>[assign](){<-}<LSEP>[](symbol){train}<LEND>[call](){}<LSEP>[](symbol){read_csv}<LSEP>[argument 0; litteral](str){../input/train.csv}<LSEP>[argument 1; litteral](real){1000.000000}<LEND>[assign](){<-}<LSEP>[](symbol){test}<LEND>[call](){}<LSEP>[](symbol){read_csv}<LSEP>[argument 0; litteral](str){../input/test.csv}<LSEP>[argument 1; litteral](real){1000.000000}<LEND>[call](){}<LSEP>[](symbol){dim}<LSEP>[](symbol){train}<LEND>[assign](){=}<LSEP>[](symbol){df}<LEND>[call](){}<LSEP>[](symbol){data.frame}<LEND>[assign](){=}<LSEP>[](symbol){df.new}<LEND>[call](){}<LSEP>[](symbol){data.frame}<LEND>[control flow](){for}<LSEP>[](symbol){i}<LEND>[range; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){nrow}<LSEP>[](symbol){train}<LEND>[body; block](){}<LSEP>[statement 0; assign](){<-}<LSEP>[](symbol){q1}<LEND>[call](){}<LSEP>[](symbol){Corpus}<LEND>[argument 0; call](){}<LSEP>[](symbol){VectorSource}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){question1}<LEND>[](symbol){i}<LEND>[statement 1; assign](){<-}<LSEP>[](symbol){q1}<LEND>[call](){}<LSEP>[](symbol){tm_map}<LSEP>[](symbol){q1}<LSEP>[](symbol){removePunctuation}<LEND>[statement 2; assign](){<-}<LSEP>[](symbol){q1}<LEND>[call](){}<LSEP>[](symbol){tm_map}<LSEP>[](symbol){q1}<LSEP>[](symbol){removeNumbers}<LEND>[statement 3; assign](){<-}<LSEP>[](symbol){q1}<LEND>[call](){}<LSEP>[](symbol){tm_map}<LSEP>[](symbol){q1}<LSEP>[](symbol){tolower}<LEND>[statement 4; assign](){<-}<LSEP>[](symbol){q1}<LEND>[call](){}<LSEP>[](symbol){tm_map}<LSEP>[](symbol){q1}<LSEP>[](symbol){stemDocument}<LEND>[statement 5; assign](){<-}<LSEP>[](symbol){q1}<LEND>[call](){}<LSEP>[](symbol){tm_map}<LSEP>[](symbol){q1}<LSEP>[](symbol){stripWhitespace}<LEND>[statement 6; assign](){<-}<LSEP>[](symbol){q1}<LEND>[call](){}<LSEP>[](symbol){tm_map}<LSEP>[](symbol){q1}<LSEP>[](symbol){removeWords}<LEND>[argument 2; call](){}<LSEP>[](symbol){stopwords}<LSEP>[argument 0; litteral](str){english}<LEND>[statement 7; assign](){<-}<LSEP>[](symbol){q1}<LEND>[call](){}<LSEP>[](symbol){tm_map}<LSEP>[](symbol){q1}<LSEP>[](symbol){PlainTextDocument}<LEND>[statement 8; assign](){=}<LSEP>[](symbol){doc}<LEND>[call](){}<LSEP>[](symbol){TermDocumentMatrix}<LSEP>[](symbol){q1}<LEND>[statement 9; assign](){=}<LSEP>[](symbol){a11}<LEND>[call](){}<LSEP>[](symbol){$}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){doc}<LSEP>[](symbol){dimnames}<LEND>[](symbol){Terms}<LEND>[statement 10; assign](){<-}<LSEP>[](symbol){q2}<LEND>[call](){}<LSEP>[](symbol){Corpus}<LEND>[argument 0; call](){}<LSEP>[](symbol){VectorSource}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){question2}<LEND>[](symbol){i}<LEND>[statement 11; assign](){<-}<LSEP>[](symbol){q2}<LEND>[call](){}<LSEP>[](symbol){tm_map}<LSEP>[](symbol){q2}<LSEP>[](symbol){removePunctuation}<LEND>[statement 12; assign](){<-}<LSEP>[](symbol){q2}<LEND>[call](){}<LSEP>[](symbol){tm_map}<LSEP>[](symbol){q2}<LSEP>[](symbol){removeNumbers}<LEND>[statement 13; assign](){<-}<LSEP>[](symbol){q2}<LEND>[call](){}<LSEP>[](symbol){tm_map}<LSEP>[](symbol){q2}<LSEP>[](symbol){tolower}<LEND>[statement 14; assign](){<-}<LSEP>[](symbol){q2}<LEND>[call](){}<LSEP>[](symbol){tm_map}<LSEP>[](symbol){q2}<LSEP>[](symbol){stemDocument}<LEND>[statement 15; assign](){<-}<LSEP>[](symbol){q2}<LEND>[call](){}<LSEP>[](symbol){tm_map}<LSEP>[](symbol){q2}<LSEP>[](symbol){stripWhitespace}<LEND>[statement 16; assign](){<-}<LSEP>[](symbol){q2}<LEND>[call](){}<LSEP>[](symbol){tm_map}<LSEP>[](symbol){q2}<LSEP>[](symbol){removeWords}<LEND>[argument 2; call](){}<LSEP>[](symbol){stopwords}<LSEP>[argument 0; litteral](str){english}<LEND>[statement 17; assign](){<-}<LSEP>[](symbol){q2}<LEND>[call](){}<LSEP>[](symbol){tm_map}<LSEP>[](symbol){q2}<LSEP>[](symbol){PlainTextDocument}<LEND>[statement 18; assign](){=}<LSEP>[](symbol){doc}<LEND>[call](){}<LSEP>[](symbol){TermDocumentMatrix}<LSEP>[](symbol){q2}<LEND>[statement 19; assign](){=}<LSEP>[](symbol){b11}<LEND>[call](){}<LSEP>[](symbol){$}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){doc}<LSEP>[](symbol){dimnames}<LEND>[](symbol){Terms}<LEND>[statement 20; assign](){=}<LSEP>[](symbol){c11}<LEND>[call](){}<LSEP>[](symbol){%in%}<LSEP>[](symbol){a11}<LSEP>[](symbol){b11}<LEND>[statement 21; assign](){=}<LSEP>[](symbol){same_items}<LEND>[call](){}<LSEP>[](symbol){sum}<LSEP>[](symbol){c11}<LEND>[statement 22; assign](){=}<LSEP>[](symbol){distinct_items}<LEND>[call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){length}<LSEP>[](symbol){a11}<LEND>[argument 1; call](){}<LSEP>[](symbol){length}<LSEP>[](symbol){b11}<LEND>[statement 23; assign](){=}<LSEP>[](symbol){match_count}<LEND>[call](){}<LSEP>[](symbol){/}<LEND>[argument 0; call](){}<LSEP>[](symbol){(}<LEND>[argument 0; call](){}<LSEP>[](symbol){*}<LSEP>[argument 0; litteral](real){2.000000}<LSEP>[](symbol){same_items}<LEND>[argument 1; call](){}<LSEP>[](symbol){(}<LSEP>[](symbol){distinct_items}<LEND>[statement 24; assign](){<-}<LSEP>[](symbol){sentiment1}<LEND>[call](){}<LSEP>[](symbol){get_nrc_sentiment}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){question1}<LEND>[](symbol){i}<LEND>[statement 25; assign](){<-}<LSEP>[](symbol){sentiment2}<LEND>[call](){}<LSEP>[](symbol){get_nrc_sentiment}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){question2}<LEND>[](symbol){i}<LEND>[](symbol){sentiment1}<LSEP>[](symbol){sentiment2}<LEND>[statement 28; assign](){=}<LSEP>[](symbol){p1}<LEND>[call](){}<LSEP>[](symbol){sum}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){sentiment1}<LSEP>[](symbol){positive}<LEND>[statement 29; assign](){=}<LSEP>[](symbol){p2}<LEND>[call](){}<LSEP>[](symbol){sum}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){sentiment2}<LSEP>[](symbol){positive}<LEND>[statement 30; assign](){=}<LSEP>[](symbol){n1}<LEND>[call](){}<LSEP>[](symbol){sum}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){sentiment1}<LSEP>[](symbol){negative}<LEND>[statement 31; assign](){=}<LSEP>[](symbol){n2}<LEND>[call](){}<LSEP>[](symbol){sum}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){sentiment2}<LSEP>[](symbol){negative}<LEND>[statement 32; assign](){=}<LSEP>[](symbol){df.new}<LEND>[call](){}<LSEP>[](symbol){cbind}<LSEP>[](symbol){match_count}<LSEP>[](symbol){p1}<LSEP>[](symbol){p2}<LSEP>[](symbol){n1}<LSEP>[](symbol){n2}<LEND>[statement 33; assign](){=}<LSEP>[](symbol){df}<LEND>[call](){}<LSEP>[](symbol){rbind}<LSEP>[](symbol){df}<LSEP>[](symbol){df.new}<LEND>[assign](){=}<LSEP>[](symbol){tr}<LEND>[call](){}<LSEP>[](symbol){cbind}<LSEP>[](symbol){train}<LSEP>[](symbol){df}<LEND>[assign](){=}<LSEP>[](symbol){tr}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){tr}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){6.000000}<LSEP>[argument 1; litteral](real){11.000000}<LEND>[assign](){=}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){tr}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){3.000000}<LSEP>[argument 1; litteral](real){6.000000}<LEND>[call](){}<LSEP>[](symbol){lapply}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){tr}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){3.000000}<LSEP>[argument 1; litteral](real){6.000000}<LEND>[](symbol){as.factor}<LEND>[assign](){=}<LSEP>[](symbol){tr}<LEND>[call](){}<LSEP>[](symbol){na.omit}<LSEP>[](symbol){tr}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){randomForest}<LEND>[assign](){<-}<LSEP>[](symbol){model}<LEND>[call](){}<LSEP>[](symbol){randomForest}<LEND>[argument 0; call](){}<LSEP>[](symbol){~}<LSEP>[](symbol){is_duplicate}<LSEP>[](symbol){.}<LEND>[](symbol){tr}<LEND>[](symbol){model}<LEND>[assign](){<-}<LSEP>[](symbol){pred}<LEND>[call](){}<LSEP>[](symbol){predict}<LSEP>[](symbol){model}<LSEP>[](symbol){tr}<LSEP>[argument 2; litteral](str){prob}<LEND>[assign](){=}<LSEP>[](symbol){pred}<LEND>[call](){}<LSEP>[](symbol){apply}<LSEP>[](symbol){pred}<LEND>[argument 1; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](real){1.000000}<LSEP>[argument 1; litteral](real){2.000000}<LEND>[](){function}<LSEP>[](pairlist){}<LSEP>[](symbol){x}<LEND>[body; call](){}<LSEP>[](symbol){min}<LEND>[argument 0; call](){}<LSEP>[](symbol){max}<LSEP>[](symbol){x}<LSEP>[argument 1; litteral](real){0.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){-}<LSEP>[argument 0; litteral](real){1.000000}<LSEP>[argument 1; litteral](real){0.000000}<LEND>[assign](){=}<LSEP>[](symbol){logLoss}<LEND>[](){function}<LSEP>[](pairlist){}<LSEP>[](symbol){pred}<LSEP>[](symbol){actual}<LEND>[body; block](){}<LSEP>[statement 0; call](){}<LSEP>[](symbol){*}<LEND>[argument 0; call](){}<LSEP>[](symbol){-}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){mean}<LEND>[argument 0; call](){}<LSEP>[](symbol){log}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){pred}<LEND>[argument 1; call](){}<LSEP>[](symbol){>}<LEND>[argument 0; call](){}<LSEP>[](symbol){-}<LEND>[argument 0; call](){}<LSEP>[](symbol){model.matrix}<LEND>[argument 0; call](){}<LSEP>[](symbol){~}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LSEP>[](symbol){actual}<LSEP>[argument 1; litteral](real){0.000000}<LEND>[](symbol){pred}<LEND>[argument 1; litteral](real){0.000000}<LEND>[call](){}<LSEP>[](symbol){logLoss}<LSEP>[](symbol){pred}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tr}<LSEP>[](symbol){is_duplicate} |
[](){expression}<LSEP>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){dplyr}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){ggplot2}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){readr}<LEND>[assign](){<-}<LSEP>[](symbol){train}<LEND>[call](){}<LSEP>[](symbol){read_csv}<LSEP>[argument 0; litteral](str){../input/train.csv.zip}<LEND>[argument 1; call](){}<LSEP>[](symbol){list}<LEND>[argument 0; call](){}<LSEP>[](symbol){col_datetime}<LEND>[assign](){<-}<LSEP>[](symbol){train}<LEND>[call](){}<LSEP>[](symbol){mutate}<LSEP>[](symbol){train}<LEND>[argument 1; call](){}<LSEP>[](symbol){as.POSIXct}<LEND>[argument 0; call](){}<LSEP>[](symbol){strftime}<LSEP>[](symbol){Dates}<LSEP>[argument 1; litteral](str){%Y-%m-%d 00:00:00}<LEND>[assign](){<-}<LSEP>[](symbol){all_offenses_per_day}<LEND>[call](){}<LSEP>[](symbol){summarise}<LEND>[argument 0; call](){}<LSEP>[](symbol){group_by}<LSEP>[](symbol){train}<LSEP>[](symbol){Date_y_m_d}<LEND>[argument 1; call](){}<LSEP>[](symbol){length}<LSEP>[](symbol){Date_y_m_d}<LEND>[assign](){=}<LSEP>[](symbol){p}<LEND>[call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){ggplot}<LSEP>[](symbol){all_offenses_per_day}<LEND>[argument 1; call](){}<LSEP>[](symbol){aes}<LSEP>[](symbol){Offences_Per_Day}<LSEP>[](symbol){Date_y_m_d}<LEND>[argument 1; call](){}<LSEP>[](symbol){geom_line}<LSEP>[argument 0; litteral](real){1.000000}<LSEP>[argument 1; litteral](str){green}<LEND>[argument 1; call](){}<LSEP>[](symbol){labs}<LSEP>[argument 0; litteral](str){Offences per/day}<LSEP>[argument 1; litteral](str){Date}<LSEP>[argument 2; litteral](str){San Francisco Offence Rate}<LEND>[argument 1; call](){}<LSEP>[](symbol){geom_smooth}<LSEP>[argument 0; litteral](str){lm}<LEND>[call](){}<LSEP>[](symbol){ggsave}<LSEP>[argument 0; litteral](str){OffenceRate.png}<LSEP>[](symbol){p}<LSEP>[argument 2; litteral](real){14.000000}<LSEP>[argument 3; litteral](real){10.000000}<LSEP>[argument 4; litteral](str){in}<LEND>[assign](){<-}<LSEP>[](symbol){train_true_crime}<LEND>[call](){}<LSEP>[](symbol){filter}<LSEP>[](symbol){train}<LEND>[argument 1; call](){}<LSEP>[](symbol){!=}<LSEP>[](symbol){Category}<LSEP>[argument 1; litteral](str){OTHER OFFENSES}<LEND>[argument 2; call](){}<LSEP>[](symbol){!=}<LSEP>[](symbol){Category}<LSEP>[argument 1; litteral](str){NON-CRIMINAL}<LEND>[assign](){<-}<LSEP>[](symbol){crimes_per_day}<LEND>[call](){}<LSEP>[](symbol){summarise}<LEND>[argument 0; call](){}<LSEP>[](symbol){group_by}<LSEP>[](symbol){train_true_crime}<LSEP>[](symbol){Date_y_m_d}<LEND>[argument 1; call](){}<LSEP>[](symbol){length}<LSEP>[](symbol){Date_y_m_d}<LEND>[assign](){=}<LSEP>[](symbol){p}<LEND>[call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){ggplot}<LSEP>[](symbol){crimes_per_day}<LEND>[argument 1; call](){}<LSEP>[](symbol){aes}<LSEP>[](symbol){Count_Per_Day}<LSEP>[](symbol){Date_y_m_d}<LEND>[argument 1; call](){}<LSEP>[](symbol){geom_line}<LSEP>[argument 0; litteral](real){1.000000}<LSEP>[argument 1; litteral](str){blue}<LEND>[argument 1; call](){}<LSEP>[](symbol){labs}<LSEP>[argument 0; litteral](str){Crime per/day}<LSEP>[argument 1; litteral](str){Date}<LSEP>[argument 2; litteral](str){San Francisco Crime Rate}<LEND>[argument 1; call](){}<LSEP>[](symbol){geom_smooth}<LSEP>[argument 0; litteral](str){lm}<LEND>[call](){}<LSEP>[](symbol){ggsave}<LSEP>[argument 0; litteral](str){CrimeRate.png}<LSEP>[](symbol){p}<LSEP>[argument 2; litteral](real){14.000000}<LSEP>[argument 3; litteral](real){10.000000}<LSEP>[argument 4; litteral](str){in}<LEND>[assign](){<-}<LSEP>[](symbol){train_no_resolution}<LEND>[call](){}<LSEP>[](symbol){filter}<LSEP>[](symbol){train_true_crime}<LEND>[argument 1; call](){}<LSEP>[](symbol){==}<LEND>[argument 0; call](){}<LSEP>[](symbol){tolower}<LSEP>[](symbol){Resolution}<LEND>[argument 1; litteral](str){none}<LEND>[assign](){<-}<LSEP>[](symbol){crimes_not_resolved}<LEND>[call](){}<LSEP>[](symbol){summarise}<LEND>[argument 0; call](){}<LSEP>[](symbol){group_by}<LSEP>[](symbol){train_no_resolution}<LSEP>[](symbol){Date_y_m_d}<LEND>[argument 1; call](){}<LSEP>[](symbol){length}<LSEP>[](symbol){Date_y_m_d}<LEND>[assign](){=}<LSEP>[](symbol){p}<LEND>[call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){ggplot}<LSEP>[](symbol){crimes_not_resolved}<LEND>[argument 1; call](){}<LSEP>[](symbol){aes}<LSEP>[](symbol){Count_Per_Day}<LSEP>[](symbol){Date_y_m_d}<LEND>[argument 1; call](){}<LSEP>[](symbol){geom_line}<LSEP>[argument 0; litteral](real){1.000000}<LSEP>[argument 1; litteral](str){red}<LEND>[argument 1; call](){}<LSEP>[](symbol){labs}<LSEP>[argument 0; litteral](str){Unresolved per/day}<LSEP>[argument 1; litteral](str){Date}<LSEP>[argument 2; litteral](str){San Francisco Unresolved Case ...}<LEND>[argument 1; call](){}<LSEP>[](symbol){geom_smooth}<LSEP>[argument 0; litteral](str){lm}<LEND>[call](){}<LSEP>[](symbol){ggsave}<LSEP>[argument 0; litteral](str){UnresolvedCase.png}<LSEP>[](symbol){p}<LSEP>[argument 2; litteral](real){14.000000}<LSEP>[argument 3; litteral](real){10.000000}<LSEP>[argument 4; litteral](str){in} |
[](){expression}<LSEP>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){ggplot2}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){readr}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){dplyr}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){formattable}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){data.table}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){gbm}<LEND>[call](){}<LSEP>[](symbol){system}<LSEP>[argument 0; litteral](str){ls ../input}<LEND>[assign](){<-}<LSEP>[](symbol){HP.train}<LEND>[call](){}<LSEP>[](symbol){read.csv}<LSEP>[argument 0; litteral](str){../input/train.csv}<LSEP>[argument 1; litteral](logical){FALSE}<LEND>[assign](){<-}<LSEP>[](symbol){HP.test}<LEND>[call](){}<LSEP>[](symbol){read.csv}<LSEP>[argument 0; litteral](str){../input/test.csv}<LSEP>[argument 1; litteral](logical){FALSE}<LEND>[assign](){<-}<LSEP>[](symbol){HP.data}<LEND>[call](){}<LSEP>[](symbol){bind_rows}<LSEP>[](symbol){HP.train}<LSEP>[](symbol){HP.test}<LEND>[assign](){<-}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){HP.data}<LEND>[call](){}<LSEP>[](symbol){sort}<LEND>[argument 0; call](){}<LSEP>[](symbol){sapply}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){1.000000}<LSEP>[argument 1; litteral](real){81.000000}<LEND>[](){function}<LSEP>[](pairlist){}<LSEP>[](symbol){x}<LEND>[body; call](){}<LSEP>[](symbol){sum}<LEND>[argument 0; call](){}<LSEP>[](symbol){is.na}<LSEP>[](symbol){x}<LEND>[argument 1; litteral](logical){TRUE}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){Alley}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){Alley}<LEND>[litteral](str){None}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtQual}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtQual}<LEND>[litteral](str){None}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtCond}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtCond}<LEND>[litteral](str){None}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtExposure}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtExposure}<LEND>[litteral](str){None}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtFinType1}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtFinType1}<LEND>[litteral](str){None}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtFinType2}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtFinType2}<LEND>[litteral](str){None}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){FireplaceQu}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){FireplaceQu}<LEND>[litteral](str){None}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){GarageType}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){GarageType}<LEND>[litteral](str){None}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){GarageFinish}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){GarageFinish}<LEND>[litteral](str){None}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){GarageQual}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){GarageQual}<LEND>[litteral](str){None}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){GarageCond}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){GarageCond}<LEND>[litteral](str){None}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){PoolQC}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){PoolQC}<LEND>[litteral](str){None}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){Fence}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){Fence}<LEND>[litteral](str){None}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){MiscFeature}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){MiscFeature}<LEND>[litteral](str){None}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){MSZoning}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){MSZoning}<LEND>[call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){data.frame}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LSEP>[](symbol){tmp0}<LEND>[argument 1; call](){}<LSEP>[](symbol){group_by}<LSEP>[](symbol){MSZoning}<LEND>[argument 1; call](){}<LSEP>[](symbol){tally}<LEND>[argument 1; call](){}<LSEP>[](symbol){top_n}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){select}<LSEP>[](symbol){MSZoning}<LEND>[argument 1; litteral](real){1.000000}<LSEP>[argument 2; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){Utilities}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){Utilities}<LEND>[call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){data.frame}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LSEP>[](symbol){tmp0}<LEND>[argument 1; call](){}<LSEP>[](symbol){group_by}<LSEP>[](symbol){Utilities}<LEND>[argument 1; call](){}<LSEP>[](symbol){tally}<LEND>[argument 1; call](){}<LSEP>[](symbol){top_n}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){select}<LSEP>[](symbol){Utilities}<LEND>[argument 1; litteral](real){1.000000}<LSEP>[argument 2; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){Exterior1st}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){Exterior1st}<LEND>[call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){data.frame}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LSEP>[](symbol){tmp0}<LEND>[argument 1; call](){}<LSEP>[](symbol){group_by}<LSEP>[](symbol){Exterior1st}<LEND>[argument 1; call](){}<LSEP>[](symbol){tally}<LEND>[argument 1; call](){}<LSEP>[](symbol){top_n}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){select}<LSEP>[](symbol){Exterior1st}<LEND>[argument 1; litteral](real){1.000000}<LSEP>[argument 2; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){Exterior2nd}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){Exterior2nd}<LEND>[call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){data.frame}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LSEP>[](symbol){tmp0}<LEND>[argument 1; call](){}<LSEP>[](symbol){group_by}<LSEP>[](symbol){Exterior2nd}<LEND>[argument 1; call](){}<LSEP>[](symbol){tally}<LEND>[argument 1; call](){}<LSEP>[](symbol){top_n}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){select}<LSEP>[](symbol){Exterior2nd}<LEND>[argument 1; litteral](real){1.000000}<LSEP>[argument 2; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){Electrical}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){Electrical}<LEND>[call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){data.frame}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LSEP>[](symbol){tmp0}<LEND>[argument 1; call](){}<LSEP>[](symbol){group_by}<LSEP>[](symbol){Electrical}<LEND>[argument 1; call](){}<LSEP>[](symbol){tally}<LEND>[argument 1; call](){}<LSEP>[](symbol){top_n}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){select}<LSEP>[](symbol){Electrical}<LEND>[argument 1; litteral](real){1.000000}<LSEP>[argument 2; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){KitchenQual}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){KitchenQual}<LEND>[call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){data.frame}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LSEP>[](symbol){tmp0}<LEND>[argument 1; call](){}<LSEP>[](symbol){group_by}<LSEP>[](symbol){KitchenQual}<LEND>[argument 1; call](){}<LSEP>[](symbol){tally}<LEND>[argument 1; call](){}<LSEP>[](symbol){top_n}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){select}<LSEP>[](symbol){KitchenQual}<LEND>[argument 1; litteral](real){1.000000}<LSEP>[argument 2; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){Functional}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){Functional}<LEND>[call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){data.frame}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LSEP>[](symbol){tmp0}<LEND>[argument 1; call](){}<LSEP>[](symbol){group_by}<LSEP>[](symbol){Functional}<LEND>[argument 1; call](){}<LSEP>[](symbol){tally}<LEND>[argument 1; call](){}<LSEP>[](symbol){top_n}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){select}<LSEP>[](symbol){Functional}<LEND>[argument 1; litteral](real){1.000000}<LSEP>[argument 2; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){SaleType}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){SaleType}<LEND>[call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){data.frame}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LSEP>[](symbol){tmp0}<LEND>[argument 1; call](){}<LSEP>[](symbol){group_by}<LSEP>[](symbol){SaleType}<LEND>[argument 1; call](){}<LSEP>[](symbol){tally}<LEND>[argument 1; call](){}<LSEP>[](symbol){top_n}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){select}<LSEP>[](symbol){SaleType}<LEND>[argument 1; litteral](real){1.000000}<LSEP>[argument 2; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){TotalBsmtSF}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){TotalBsmtSF}<LEND>[call](){}<LSEP>[](symbol){mean}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){TotalBsmtSF}<LEND>[argument 1; call](){}<LSEP>[](symbol){!}<LEND>[argument 0; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){TotalBsmtSF}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtFinSF1}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtFinSF1}<LEND>[call](){}<LSEP>[](symbol){mean}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtFinSF1}<LEND>[argument 1; call](){}<LSEP>[](symbol){!}<LEND>[argument 0; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtFinSF1}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtFinSF2}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtFinSF2}<LEND>[call](){}<LSEP>[](symbol){mean}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtFinSF2}<LEND>[argument 1; call](){}<LSEP>[](symbol){!}<LEND>[argument 0; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtFinSF2}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtUnfSF}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtUnfSF}<LEND>[call](){}<LSEP>[](symbol){mean}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtUnfSF}<LEND>[argument 1; call](){}<LSEP>[](symbol){!}<LEND>[argument 0; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtUnfSF}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){GarageArea}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){GarageArea}<LEND>[call](){}<LSEP>[](symbol){mean}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){GarageArea}<LEND>[argument 1; call](){}<LSEP>[](symbol){!}<LEND>[argument 0; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){GarageArea}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){GarageCars}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){GarageCars}<LEND>[call](){}<LSEP>[](symbol){mean}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){GarageCars}<LEND>[argument 1; call](){}<LSEP>[](symbol){!}<LEND>[argument 0; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){GarageCars}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){MasVnrArea}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){MasVnrArea}<LEND>[call](){}<LSEP>[](symbol){mean}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){MasVnrArea}<LEND>[argument 1; call](){}<LSEP>[](symbol){!}<LEND>[argument 0; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){MasVnrArea}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){LotFrontage}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){LotFrontage}<LEND>[call](){}<LSEP>[](symbol){mean}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){LotFrontage}<LEND>[argument 1; call](){}<LSEP>[](symbol){!}<LEND>[argument 0; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){LotFrontage}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){MasVnrType}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){MasVnrType}<LEND>[litteral](str){None}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtFullBath}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtFullBath}<LEND>[litteral](real){0.000000}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtHalfBath}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){BsmtHalfBath}<LEND>[litteral](real){0.000000}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){GarageYrBlt}<LEND>[call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){YearBuilt}<LEND>[call](){}<LSEP>[](symbol){sort}<LEND>[argument 0; call](){}<LSEP>[](symbol){sapply}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){tmp0}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){1.000000}<LSEP>[argument 1; litteral](real){81.000000}<LEND>[](){function}<LSEP>[](pairlist){}<LSEP>[](symbol){x}<LEND>[body; call](){}<LSEP>[](symbol){sum}<LEND>[argument 0; call](){}<LSEP>[](symbol){is.na}<LSEP>[](symbol){x}<LEND>[argument 1; litteral](logical){TRUE}<LEND>[assign](){<-}<LSEP>[](symbol){tmp1}<LSEP>[](symbol){tmp0}<LEND>[control flow](){for}<LSEP>[](symbol){i}<LEND>[range; call](){}<LSEP>[](symbol){colnames}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){tmp1}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){sapply}<LSEP>[](symbol){tmp1}<LSEP>[](symbol){is.character}<LEND>[body; block](){}<LSEP>[statement 0; assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){tmp1}<LSEP>[](symbol){}<LSEP>[](symbol){i}<LEND>[call](){}<LSEP>[](symbol){as.factor}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){tmp1}<LSEP>[](symbol){}<LSEP>[](symbol){i}<LEND>[assign](){=}<LSEP>[](symbol){features}<LEND>[call](){}<LSEP>[](symbol){names}<LSEP>[](symbol){tmp1}<LEND>[control flow](){for}<LSEP>[](symbol){f}<LSEP>[](symbol){features}<LEND>[body; block](){}<LSEP>[statement 0; control flow](){if}<LSEP>[condition; call](){}<LSEP>[](symbol){==}<LEND>[argument 0; call](){}<LSEP>[](symbol){class}<LEND>[argument 0; call](){}<LSEP>[](symbol){[[}<LSEP>[](symbol){tmp1}<LSEP>[](symbol){f}<LEND>[argument 1; litteral](str){character}<LEND>[true branch; block](){}<LSEP>[statement 0; assign](){=}<LSEP>[](symbol){levels}<LEND>[call](){}<LSEP>[](symbol){sort}<LEND>[argument 0; call](){}<LSEP>[](symbol){unique}<LEND>[argument 0; call](){}<LSEP>[](symbol){[[}<LSEP>[](symbol){tmp1}<LSEP>[](symbol){f}<LEND>[statement 1; assign](){=}<LSEP>[variable; call](){}<LSEP>[](symbol){[[}<LSEP>[](symbol){tmp1}<LSEP>[](symbol){f}<LEND>[call](){}<LSEP>[](symbol){as.integer}<LEND>[argument 0; call](){}<LSEP>[](symbol){factor}<LEND>[argument 0; call](){}<LSEP>[](symbol){[[}<LSEP>[](symbol){tmp1}<LSEP>[](symbol){f}<LEND>[](symbol){levels}<LEND>[assign](){<-}<LSEP>[](symbol){tmp1}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){tmp1}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){-}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[](symbol){tmp.train}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){tmp1}<LEND>[argument 1; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){1.000000}<LSEP>[argument 1; litteral](real){1460.000000}<LEND>[](symbol){}<LEND>[assign](){<-}<LSEP>[](symbol){tmp.test}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){tmp1}<LEND>[argument 1; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){1461.000000}<LSEP>[argument 1; litteral](real){2919.000000}<LEND>[](symbol){}<LEND>[assign](){<-}<LSEP>[](symbol){model}<LEND>[call](){}<LSEP>[](symbol){gbm}<LEND>[argument 0; call](){}<LSEP>[](symbol){~}<LSEP>[](symbol){SalePrice}<LSEP>[](symbol){.}<LEND>[](symbol){tmp.train}<LSEP>[argument 2; litteral](str){laplace}<LSEP>[argument 3; litteral](real){0.050000}<LSEP>[argument 4; litteral](real){5.000000}<LSEP>[argument 5; litteral](real){0.660000}<LSEP>[argument 6; litteral](real){1.000000}<LSEP>[argument 7; litteral](real){100.000000}<LSEP>[](symbol){F}<LSEP>[](symbol){F}<LSEP>[argument 10; litteral](real){500.000000}<LEND>[assign](){<-}<LSEP>[](symbol){output}<LEND>[call](){}<LSEP>[](symbol){predict}<LSEP>[](symbol){model}<LSEP>[](symbol){tmp.test}<LSEP>[argument 2; litteral](real){500.000000}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){tmp.test}<LSEP>[](symbol){SalePrice}<LEND>[litteral](NULL){NULL}<LEND>[assign](){<-}<LSEP>[](symbol){output.data}<LEND>[call](){}<LSEP>[](symbol){data.frame}<LSEP>[](symbol){tmp.test}<LSEP>[](symbol){output}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){output.data}<LSEP>[](symbol){Id}<LEND>[call](){}<LSEP>[](symbol){rownames}<LSEP>[](symbol){output.data}<LEND>[call](){}<LSEP>[](symbol){setnames}<LSEP>[](symbol){output.data}<LEND>[argument 1; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){output}<LEND>[argument 2; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){SalePrice}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){rownames}<LSEP>[](symbol){output.data}<LEND>[litteral](NULL){NULL}<LEND>[assign](){<-}<LSEP>[](symbol){output.data}<LEND>[call](){}<LSEP>[](symbol){%>%}<LSEP>[](symbol){output.data}<LEND>[argument 1; call](){}<LSEP>[](symbol){select}<LSEP>[](symbol){Id}<LSEP>[](symbol){SalePrice}<LEND>[call](){}<LSEP>[](symbol){write.csv}<LSEP>[](symbol){output.data}<LSEP>[argument 1; litteral](str){Output_GBM.csv}<LSEP>[argument 2; litteral](logical){FALSE} |
[](){expression}<LSEP>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){randomForest}<LEND>[call](){}<LSEP>[](symbol){set.seed}<LSEP>[argument 0; litteral](real){0.000000}<LEND>[assign](){=}<LSEP>[](symbol){numSample}<LSEP>[litteral](real){10000.000000}<LEND>[assign](){<-}<LSEP>[](symbol){numTrees}<LSEP>[litteral](real){100.000000}<LEND>[assign](){<-}<LSEP>[](symbol){train}<LEND>[call](){}<LSEP>[](symbol){read.csv}<LSEP>[argument 0; litteral](str){../input/train.csv}<LEND>[assign](){<-}<LSEP>[](symbol){test}<LEND>[call](){}<LSEP>[](symbol){read.csv}<LSEP>[argument 0; litteral](str){../input/test.csv}<LEND>[assign](){<-}<LSEP>[](symbol){rows}<LEND>[call](){}<LSEP>[](symbol){sample}<LEND>[argument 0; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){nrow}<LSEP>[](symbol){train}<LEND>[argument 1; call](){}<LSEP>[](symbol){nrow}<LSEP>[](symbol){train}<LEND>[assign](){<-}<LSEP>[](symbol){labels}<LEND>[call](){}<LSEP>[](symbol){as.factor}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){train}<LSEP>[](symbol){rows}<LSEP>[](symbol){}<LEND>[](symbol){label}<LEND>[assign](){<-}<LSEP>[](symbol){train}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){train}<LSEP>[](symbol){rows}<LEND>[argument 2; call](){}<LSEP>[](symbol){-}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[](symbol){train}<LEND>[call](){}<LSEP>[](symbol){cbind}<LSEP>[](symbol){train}<LEND>[argument 1; call](){}<LSEP>[](symbol){rowMeans}<LSEP>[](symbol){train}<LEND>[argument 2; call](){}<LSEP>[](symbol){(}<LEND>[argument 0; call](){}<LSEP>[](symbol){-}<LEND>[argument 0; call](){}<LSEP>[](symbol){rowMeans}<LEND>[argument 0; call](){}<LSEP>[](symbol){*}<LSEP>[](symbol){train}<LSEP>[](symbol){train}<LEND>[argument 1; call](){}<LSEP>[](symbol){^}<LEND>[argument 0; call](){}<LSEP>[](symbol){rowMeans}<LSEP>[](symbol){train}<LEND>[argument 1; litteral](real){2.000000}<LEND>[assign](){<-}<LSEP>[](symbol){test}<LEND>[call](){}<LSEP>[](symbol){cbind}<LSEP>[](symbol){test}<LEND>[argument 1; call](){}<LSEP>[](symbol){rowMeans}<LSEP>[](symbol){test}<LEND>[argument 2; call](){}<LSEP>[](symbol){(}<LEND>[argument 0; call](){}<LSEP>[](symbol){-}<LEND>[argument 0; call](){}<LSEP>[](symbol){rowMeans}<LEND>[argument 0; call](){}<LSEP>[](symbol){*}<LSEP>[](symbol){test}<LSEP>[](symbol){test}<LEND>[argument 1; call](){}<LSEP>[](symbol){^}<LEND>[argument 0; call](){}<LSEP>[](symbol){rowMeans}<LSEP>[](symbol){test}<LEND>[argument 1; litteral](real){2.000000}<LEND>[assign](){<-}<LSEP>[](symbol){rf}<LEND>[call](){}<LSEP>[](symbol){randomForest}<LSEP>[](symbol){train}<LSEP>[](symbol){labels}<LSEP>[](symbol){test}<LSEP>[](symbol){numTrees}<LEND>[assign](){<-}<LSEP>[](symbol){predictions}<LEND>[call](){}<LSEP>[](symbol){data.frame}<LEND>[argument 0; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){nrow}<LSEP>[](symbol){test}<LEND>[argument 1; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){levels}<LSEP>[](symbol){labels}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){rf}<LSEP>[](symbol){test}<LEND>[](symbol){predicted}<LEND>[call](){}<LSEP>[](symbol){head}<LSEP>[](symbol){predictions}<LEND>[call](){}<LSEP>[](symbol){write.csv}<LSEP>[](symbol){predictions}<LSEP>[argument 1; litteral](str){submission.csv}<LSEP>[argument 2; litteral](logical){FALSE} |
[](){expression}<LSEP>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){ggplot2}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){randomForest}<LEND>[call](){}<LSEP>[](symbol){set.seed}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[](symbol){train}<LEND>[call](){}<LSEP>[](symbol){read.csv}<LSEP>[argument 0; litteral](str){../input/train.csv}<LSEP>[argument 1; litteral](logical){FALSE}<LEND>[assign](){<-}<LSEP>[](symbol){test}<LEND>[call](){}<LSEP>[](symbol){read.csv}<LSEP>[argument 0; litteral](str){../input/test.csv}<LSEP>[argument 1; litteral](logical){FALSE}<LEND>[assign](){<-}<LSEP>[](symbol){extractFeatures}<LEND>[](){function}<LSEP>[](pairlist){}<LSEP>[](symbol){data}<LEND>[body; block](){}<LSEP>[statement 0; assign](){<-}<LSEP>[](symbol){features}<LEND>[call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){Pclass}<LSEP>[argument 1; litteral](str){Age}<LSEP>[argument 2; litteral](str){Sex}<LSEP>[argument 3; litteral](str){Parch}<LSEP>[argument 4; litteral](str){SibSp}<LSEP>[argument 5; litteral](str){Fare}<LSEP>[argument 6; litteral](str){Embarked}<LEND>[statement 1; assign](){<-}<LSEP>[](symbol){fea}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){data}<LSEP>[](symbol){}<LSEP>[](symbol){features}<LEND>[statement 2; assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fea}<LSEP>[](symbol){Age}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fea}<LSEP>[](symbol){Age}<LEND>[call](){}<LSEP>[](symbol){-}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[statement 3; assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fea}<LSEP>[](symbol){Fare}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fea}<LSEP>[](symbol){Fare}<LEND>[call](){}<LSEP>[](symbol){median}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fea}<LSEP>[](symbol){Fare}<LEND>[argument 1; litteral](logical){TRUE}<LEND>[statement 4; assign](){=}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fea}<LSEP>[](symbol){Embarked}<LEND>[argument 1; call](){}<LSEP>[](symbol){==}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fea}<LSEP>[](symbol){Embarked}<LEND>[argument 1; litteral](str){}<LEND>[litteral](str){S}<LEND>[statement 5; assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fea}<LSEP>[](symbol){Sex}<LEND>[call](){}<LSEP>[](symbol){as.factor}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fea}<LSEP>[](symbol){Sex}<LEND>[statement 6; assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fea}<LSEP>[](symbol){Embarked}<LEND>[call](){}<LSEP>[](symbol){as.factor}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fea}<LSEP>[](symbol){Embarked}<LEND>[statement 7; call](){}<LSEP>[](symbol){return}<LSEP>[](symbol){fea}<LEND>[call](){}<LSEP>[](symbol){require}<LSEP>[](symbol){caret}<LEND>[assign](){<-}<LSEP>[](symbol){metric}<LSEP>[litteral](str){Accuracy}<LEND>[assign](){<-}<LSEP>[](symbol){control}<LEND>[call](){}<LSEP>[](symbol){trainControl}<LSEP>[argument 0; litteral](str){repeatedcv}<LSEP>[argument 1; litteral](real){10.000000}<LSEP>[argument 2; litteral](real){3.000000}<LSEP>[argument 3; litteral](str){grid}<LEND>[assign](){<-}<LSEP>[](symbol){tunegrid}<LEND>[call](){}<LSEP>[](symbol){expand.grid}<LEND>[argument 0; call](){}<LSEP>[](symbol){c}<LEND>[argument 0; call](){}<LSEP>[](symbol){sqrt}<LEND>[argument 0; call](){}<LSEP>[](symbol){ncol}<LSEP>[](symbol){train}<LEND>[assign](){<-}<LSEP>[](symbol){modellist}<LEND>[call](){}<LSEP>[](symbol){list}<LEND>[assign](){<-}<LSEP>[](symbol){data}<LEND>[call](){}<LSEP>[](symbol){extractFeatures}<LSEP>[](symbol){train}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){data}<LSEP>[](symbol){Survived}<LEND>[call](){}<LSEP>[](symbol){as.factor}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){Survived}<LEND>[control flow](){for}<LSEP>[](symbol){ntree}<LEND>[range; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](real){100.000000}<LSEP>[argument 1; litteral](real){200.000000}<LSEP>[argument 2; litteral](real){300.000000}<LEND>[body; block](){}<LSEP>[statement 0; call](){}<LSEP>[](symbol){set.seed}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[statement 1; assign](){<-}<LSEP>[](symbol){fit}<LEND>[call](){}<LSEP>[](symbol){train}<LEND>[argument 0; call](){}<LSEP>[](symbol){~}<LSEP>[](symbol){Survived}<LSEP>[](symbol){.}<LEND>[](symbol){data}<LSEP>[argument 2; litteral](str){rf}<LSEP>[](symbol){metric}<LSEP>[](symbol){tunegrid}<LSEP>[](symbol){control}<LSEP>[](symbol){ntree}<LEND>[statement 2; assign](){<-}<LSEP>[](symbol){key}<LEND>[call](){}<LSEP>[](symbol){toString}<LSEP>[](symbol){ntree}<LEND>[statement 3; assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[[}<LSEP>[](symbol){modellist}<LSEP>[](symbol){key}<LEND>[](symbol){fit}<LEND>[assign](){<-}<LSEP>[](symbol){results}<LEND>[call](){}<LSEP>[](symbol){resamples}<LSEP>[](symbol){modellist}<LEND>[call](){}<LSEP>[](symbol){summary}<LSEP>[](symbol){results}<LEND>[call](){}<LSEP>[](symbol){dotplot}<LSEP>[](symbol){results}<LEND>[assign](){<-}<LSEP>[](symbol){rf}<LEND>[call](){}<LSEP>[](symbol){randomForest}<LEND>[argument 0; call](){}<LSEP>[](symbol){extractFeatures}<LSEP>[](symbol){train}<LEND>[argument 1; call](){}<LSEP>[](symbol){as.factor}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){Survived}<LEND>[](symbol){ntree}<LSEP>[argument 3; litteral](logical){TRUE}<LEND>[assign](){<-}<LSEP>[](symbol){submission}<LEND>[call](){}<LSEP>[](symbol){data.frame}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){test}<LSEP>[](symbol){PassengerId}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){submission}<LSEP>[](symbol){Survived}<LEND>[call](){}<LSEP>[](symbol){predict}<LSEP>[](symbol){rf}<LEND>[argument 1; call](){}<LSEP>[](symbol){extractFeatures}<LSEP>[](symbol){test}<LEND>[call](){}<LSEP>[](symbol){write.csv}<LSEP>[](symbol){submission}<LSEP>[argument 1; litteral](str){1_random_forest_r_submission.csv}<LSEP>[argument 2; litteral](logical){FALSE}<LEND>[assign](){<-}<LSEP>[](symbol){imp}<LEND>[call](){}<LSEP>[](symbol){importance}<LSEP>[](symbol){rf}<LSEP>[argument 1; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[](symbol){featureImportance}<LEND>[call](){}<LSEP>[](symbol){data.frame}<LEND>[argument 0; call](){}<LSEP>[](symbol){row.names}<LSEP>[](symbol){imp}<LEND>[argument 1; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){imp}<LSEP>[](symbol){}<LSEP>[argument 2; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[](symbol){p}<LEND>[call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){ggplot}<LSEP>[](symbol){featureImportance}<LEND>[argument 1; call](){}<LSEP>[](symbol){aes}<LEND>[argument 0; call](){}<LSEP>[](symbol){reorder}<LSEP>[](symbol){Feature}<LSEP>[](symbol){Importance}<LEND>[](symbol){Importance}<LEND>[argument 1; call](){}<LSEP>[](symbol){geom_bar}<LSEP>[argument 0; litteral](str){identity}<LSEP>[argument 1; litteral](str){#53cfff}<LEND>[argument 1; call](){}<LSEP>[](symbol){coord_flip}<LEND>[argument 1; call](){}<LSEP>[](symbol){theme_light}<LSEP>[argument 0; litteral](real){20.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){xlab}<LSEP>[argument 0; litteral](str){}<LEND>[argument 1; call](){}<LSEP>[](symbol){ylab}<LSEP>[argument 0; litteral](str){Importance}<LEND>[argument 1; call](){}<LSEP>[](symbol){ggtitle}<LSEP>[argument 0; litteral](str){Random Forest Feature Importan...}<LEND>[argument 1; call](){}<LSEP>[](symbol){theme}<LEND>[argument 0; call](){}<LSEP>[](symbol){element_text}<LSEP>[argument 0; litteral](real){18.000000}<LEND>[call](){}<LSEP>[](symbol){ggsave}<LSEP>[argument 0; litteral](str){2_feature_importance.png}<LSEP>[](symbol){p} |
[](){expression}<LSEP>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){randomForest}<LEND>[assign](){<-}<LSEP>[](symbol){train}<LEND>[call](){}<LSEP>[](symbol){read.csv}<LSEP>[argument 0; litteral](str){../input/train.csv}<LEND>[assign](){<-}<LSEP>[](symbol){test}<LEND>[call](){}<LSEP>[](symbol){read.csv}<LSEP>[argument 0; litteral](str){../input/test.csv}<LEND>[call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){Survived}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){Survived}<LEND>[call](){}<LSEP>[](symbol){factor}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){Survived}<LEND>[argument 1; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](real){1.000000}<LSEP>[argument 1; litteral](real){0.000000}<LEND>[call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){Survived}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){levels}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){Survived}<LEND>[call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){Survived}<LSEP>[argument 1; litteral](str){Died}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){Pclass}<LEND>[call](){}<LSEP>[](symbol){as.factor}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){Pclass}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){levels}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){Pclass}<LEND>[call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){1st Class}<LSEP>[argument 1; litteral](str){2nd Class}<LSEP>[argument 2; litteral](str){3rd Class}<LEND>[call](){}<LSEP>[](symbol){png}<LSEP>[argument 0; litteral](str){1_survival_by_class.png}<LSEP>[argument 1; litteral](real){800.000000}<LSEP>[argument 2; litteral](real){600.000000}<LEND>[call](){}<LSEP>[](symbol){mosaicplot}<LEND>[argument 0; call](){}<LSEP>[](symbol){~}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){Pclass}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){Survived}<LEND>[argument 1; litteral](str){Passenger Survival by Class}<LEND>[argument 2; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){#8dd3c7}<LSEP>[argument 1; litteral](str){#fb8072}<LEND>[argument 3; litteral](logical){FALSE}<LSEP>[argument 4; litteral](str){}<LSEP>[argument 5; litteral](str){}<LEND>[argument 6; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](real){0.000000}<LEND>[argument 7; litteral](real){1.400000}<LEND>[call](){}<LSEP>[](symbol){dev.off} |
[](){expression}<LSEP>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){data.table}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){leaflet}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){geosphere}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){IM}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){lubridate}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){plotly}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){Matrix}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){dygraphs}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){xts}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){RColorBrewer}<LEND>[call](){}<LSEP>[](symbol){set.seed}<LSEP>[argument 0; litteral](real){0.000000}<LEND>[assign](){<-}<LSEP>[](symbol){train}<LEND>[call](){}<LSEP>[](symbol){fread}<LSEP>[argument 0; litteral](str){../input/train.csv}<LSEP>[argument 1; litteral](logical){FALSE}<LEND>[assign](){<-}<LSEP>[](symbol){train_ts}<LEND>[call](){}<LSEP>[](symbol){copy}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){train}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){.}<LSEP>[](symbol){pickup_datetime}<LSEP>[](symbol){dropoff_datetime}<LSEP>[](symbol){passenger_count}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){train_ts}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){:=}<LSEP>[](symbol){pickup_datetime}<LEND>[argument 1; call](){}<LSEP>[](symbol){ymd_hms}<LSEP>[](symbol){pickup_datetime}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){train_ts}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){:=}<LSEP>[](symbol){dropoff_datetime}<LEND>[argument 1; call](){}<LSEP>[](symbol){ymd_hms}<LSEP>[](symbol){dropoff_datetime}<LEND>[assign](){<-}<LSEP>[](symbol){pickups}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){train_ts}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){.}<LSEP>[](symbol){.N}<LEND>[argument 1; call](){}<LSEP>[](symbol){sum}<LSEP>[](symbol){passenger_count}<LEND>[](symbol){pickup_datetime}<LEND>[assign](){<-}<LSEP>[](symbol){dropoffs}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){train_ts}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){.}<LSEP>[](symbol){.N}<LEND>[argument 1; call](){}<LSEP>[](symbol){sum}<LSEP>[](symbol){passenger_count}<LEND>[](symbol){dropoff_datetime}<LEND>[call](){}<LSEP>[](symbol){setnames}<LSEP>[](symbol){pickups}<LSEP>[argument 1; litteral](str){pickup_datetime}<LSEP>[argument 2; litteral](str){datetime}<LEND>[call](){}<LSEP>[](symbol){setnames}<LSEP>[](symbol){dropoffs}<LSEP>[argument 1; litteral](str){dropoff_datetime}<LSEP>[argument 2; litteral](str){datetime}<LEND>[assign](){<-}<LSEP>[](symbol){trips}<LEND>[call](){}<LSEP>[](symbol){merge}<LSEP>[](symbol){pickups}<LSEP>[](symbol){dropoffs}<LSEP>[argument 2; litteral](str){datetime}<LSEP>[](symbol){T}<LEND>[control flow](){for}<LSEP>[](symbol){n}<LEND>[range; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){names}<LSEP>[](symbol){trips}<LEND>[argument 1; call](){}<LSEP>[](symbol){-}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[body; call](){}<LSEP>[](symbol){set}<LSEP>[](symbol){trips}<LEND>[argument 1; call](){}<LSEP>[](symbol){which}<LEND>[argument 0; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){[[}<LSEP>[](symbol){trips}<LSEP>[](symbol){n}<LEND>[](symbol){n}<LSEP>[argument 3; litteral](integer){0}<LEND>[assign](){<-}<LSEP>[](symbol){valueCalc}<LEND>[](){function}<LSEP>[](pairlist){}<LSEP>[](symbol){value_on}<LSEP>[](symbol){value_off}<LEND>[body; block](){}<LSEP>[statement 0; assign](){<-}<LSEP>[](symbol){diff2int}<LEND>[](){function}<LSEP>[](pairlist){}<LSEP>[](symbol){x}<LSEP>[](symbol){y}<LEND>[body; call](){}<LSEP>[](symbol){as.integer}<LEND>[argument 0; call](){}<LSEP>[](symbol){difftime}<LSEP>[](symbol){x}<LSEP>[](symbol){y}<LSEP>[argument 2; litteral](str){secs}<LEND>[statement 1; assign](){<-}<LSEP>[](symbol){N}<LEND>[call](){}<LSEP>[](symbol){+}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){trips}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){diff2int}<LEND>[argument 0; call](){}<LSEP>[](symbol){max}<LSEP>[](symbol){datetime}<LEND>[argument 1; call](){}<LSEP>[](symbol){min}<LSEP>[](symbol){datetime}<LEND>[statement 2; assign](){<-}<LSEP>[](symbol){inds}<LEND>[call](){}<LSEP>[](symbol){+}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){trips}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){diff2int}<LSEP>[](symbol){datetime}<LEND>[argument 1; call](){}<LSEP>[](symbol){min}<LSEP>[](symbol){datetime}<LEND>[statement 3; assign](){<-}<LSEP>[](symbol){values}<LEND>[call](){}<LSEP>[](symbol){sparseVector}<LEND>[argument 0; call](){}<LSEP>[](symbol){-}<LSEP>[](symbol){value_on}<LSEP>[](symbol){value_off}<LEND>[](symbol){inds}<LSEP>[](symbol){N}<LEND>[statement 4; call](){}<LSEP>[](symbol){cumsum}<LSEP>[](symbol){values}<LEND>[assign](){<-}<LSEP>[](symbol){total_trips}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){trips}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){valueCalc}<LSEP>[](symbol){trips_on}<LSEP>[](symbol){trips_off}<LEND>[assign](){<-}<LSEP>[](symbol){total_passengers}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){trips}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){valueCalc}<LSEP>[](symbol){passenger_on}<LSEP>[](symbol){passenger_off}<LEND>[assign](){<-}<LSEP>[](symbol){total_values}<LEND>[call](){}<LSEP>[](symbol){data.table}<LSEP>[](symbol){total_trips}<LSEP>[](symbol){total_passengers}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){total_values}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){:=}<LSEP>[](symbol){time}<LEND>[argument 1; call](){}<LSEP>[](symbol){as.POSIXct}<LEND>[argument 0; call](){}<LSEP>[](symbol){-}<LSEP>[](symbol){.I}<LSEP>[argument 1; litteral](real){1.000000}<LEND>[argument 1; litteral](str){2016-01-01 00:00:17}<LSEP>[argument 2; litteral](str){UTC}<LEND>[assign](){<-}<LSEP>[](symbol){plotTS}<LEND>[](){function}<LSEP>[](pairlist){}<LSEP>[](symbol){value_col}<LSEP>[](symbol){n_days}<LSEP>[](symbol){...}<LEND>[body; block](){}<LSEP>[statement 0; assign](){<-}<LSEP>[](symbol){trip_ts}<LEND>[call](){}<LSEP>[](symbol){xts}<LEND>[argument 0; call](){}<LSEP>[](symbol){[[}<LSEP>[](symbol){total_values}<LSEP>[](symbol){value_col}<LEND>[argument 1; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){total_values}<LSEP>[](symbol){time}<LEND>[argument 2; litteral](str){America/New_York}<LEND>[statement 1; assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){names}<LSEP>[](symbol){trip_ts}<LEND>[](symbol){value_col}<LEND>[statement 2; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){dygraph}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){trip_ts}<LEND>[argument 1; call](){}<LSEP>[](symbol){seq}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){*}<LSEP>[](symbol){n_days}<LSEP>[argument 1; litteral](real){86400.000000}<LEND>[argument 2; call](){}<LSEP>[](symbol){*}<LSEP>[argument 0; litteral](real){5.000000}<LSEP>[argument 1; litteral](real){60.000000}<LEND>[](symbol){...}<LEND>[argument 1; call](){}<LSEP>[](symbol){dyRangeSelector}<LEND>[argument 1; call](){}<LSEP>[](symbol){dyRangeSelector}<LSEP>[argument 0; litteral](real){18.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){dyOptions}<LSEP>[argument 0; litteral](logical){TRUE}<LSEP>[argument 1; litteral](real){0.500000}<LEND>[argument 1; call](){}<LSEP>[](symbol){dyAxis}<LSEP>[argument 0; litteral](str){y}<LEND>[argument 1; call](){}<LSEP>[](symbol){gsub}<LSEP>[argument 0; litteral](str){_}<LSEP>[argument 1; litteral](str){ }<LSEP>[](symbol){value_col}<LEND>[argument 1; call](){}<LSEP>[](symbol){dyAxis}<LSEP>[argument 0; litteral](str){x}<LSEP>[argument 1; litteral](str){Time}<LEND>[argument 1; call](){}<LSEP>[](symbol){dyOptions}<LSEP>[argument 0; litteral](logical){TRUE}<LEND>[call](){}<LSEP>[](symbol){plotTS}<LSEP>[argument 0; litteral](str){total_trips}<LSEP>[argument 1; litteral](real){31.000000}<LSEP>[argument 2; litteral](str){Total Trips in January}<LEND>[call](){}<LSEP>[](symbol){plotTS}<LSEP>[argument 0; litteral](str){total_passengers}<LSEP>[argument 1; litteral](real){31.000000}<LSEP>[argument 2; litteral](str){Total Passengers in January}<LEND>[call](){}<LSEP>[](symbol){rm}<LEND>[argument 0; call](){}<LSEP>[](symbol){setdiff}<LEND>[argument 0; call](){}<LSEP>[](symbol){ls}<LEND>[argument 1; litteral](str){train}<LEND>[call](){}<LSEP>[](symbol){gc}<LEND>[assign](){<-}<LSEP>[](symbol){densityCalc}<LEND>[](){function}<LSEP>[](pairlist){}<LSEP>[](symbol){dt}<LEND>[body; block](){}<LSEP>[statement 0; assign](){<-}<LSEP>[](symbol){dow}<LEND>[call](){}<LSEP>[](symbol){wday}<LSEP>[](symbol){dt}<LEND>[statement 1; assign](){<-}<LSEP>[](symbol){tod}<LEND>[call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){hour}<LSEP>[](symbol){dt}<LEND>[argument 1; call](){}<LSEP>[](symbol){/}<LEND>[argument 0; call](){}<LSEP>[](symbol){minute}<LSEP>[](symbol){dt}<LEND>[argument 1; litteral](real){60.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){/}<LEND>[argument 0; call](){}<LSEP>[](symbol){second}<LSEP>[](symbol){dt}<LEND>[argument 1; litteral](real){3600.000000}<LEND>[statement 2; assign](){<-}<LSEP>[](symbol){time}<LEND>[call](){}<LSEP>[](symbol){+}<LSEP>[](symbol){tod}<LEND>[argument 1; call](){}<LSEP>[](symbol){*}<LSEP>[argument 0; litteral](real){24.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){(}<LEND>[argument 0; call](){}<LSEP>[](symbol){-}<LSEP>[](symbol){dow}<LSEP>[argument 1; litteral](real){1.000000}<LEND>[statement 3; assign](){<-}<LSEP>[](symbol){density_matrix}<LEND>[call](){}<LSEP>[](symbol){matrix}<LSEP>[argument 0; litteral](real){0.000000}<LSEP>[argument 1; litteral](real){7.000000}<LSEP>[argument 2; litteral](real){1441.000000}<LEND>[statement 4; control flow](){for}<LSEP>[](symbol){k}<LEND>[range; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){1.000000}<LSEP>[argument 1; litteral](real){7.000000}<LEND>[body; block](){}<LSEP>[statement 0; assign](){<-}<LSEP>[](symbol){t}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){train}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){-}<LSEP>[](symbol){time}<LEND>[argument 1; call](){}<LSEP>[](symbol){*}<LSEP>[argument 0; litteral](real){24.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){(}<LEND>[argument 0; call](){}<LSEP>[](symbol){-}<LSEP>[](symbol){k}<LSEP>[argument 1; litteral](real){1.000000}<LEND>[statement 1; assign](){<-}<LSEP>[](symbol){t}<LEND>[call](){}<LSEP>[](symbol){-}<LEND>[argument 0; call](){}<LSEP>[](symbol){%%}<LEND>[argument 0; call](){}<LSEP>[](symbol){(}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LSEP>[](symbol){t}<LEND>[argument 1; call](){}<LSEP>[](symbol){*}<LSEP>[argument 0; litteral](real){3.500000}<LSEP>[argument 1; litteral](real){24.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){(}<LEND>[argument 0; call](){}<LSEP>[](symbol){*}<LSEP>[argument 0; litteral](real){24.000000}<LSEP>[argument 1; litteral](real){7.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){*}<LSEP>[argument 0; litteral](real){3.500000}<LSEP>[argument 1; litteral](real){24.000000}<LEND>[statement 2; assign](){<-}<LSEP>[](symbol){ind}<LEND>[call](){}<LSEP>[](symbol){-}<LSEP>[argument 0; litteral](real){7.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){(}<LEND>[argument 0; call](){}<LSEP>[](symbol){%%}<LEND>[argument 0; call](){}<LSEP>[](symbol){(}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LSEP>[](symbol){k}<LSEP>[argument 1; litteral](real){5.000000}<LEND>[argument 1; litteral](real){7.000000}<LEND>[statement 3; assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){density_matrix}<LSEP>[](symbol){ind}<LSEP>[](symbol){}<LEND>[call](){}<LSEP>[](symbol){$}<LEND>[argument 0; call](){}<LSEP>[](symbol){density}<LSEP>[](symbol){t}<LSEP>[argument 1; litteral](real){0.000000}<LSEP>[argument 2; litteral](real){24.000000}<LSEP>[argument 3; litteral](real){2.000000}<LSEP>[argument 4; litteral](real){1441.000000}<LEND>[](symbol){y}<LEND>[statement 5; assign](){<-}<LSEP>[](symbol){density_matrix}<LEND>[call](){}<LSEP>[](symbol){round}<LEND>[argument 0; call](){}<LSEP>[](symbol){/}<LSEP>[](symbol){density_matrix}<LEND>[argument 1; call](){}<LSEP>[](symbol){max}<LSEP>[](symbol){density_matrix}<LEND>[argument 1; litteral](real){5.000000}<LEND>[](symbol){density_matrix}<LEND>[assign](){<-}<LSEP>[](symbol){heat_ly}<LEND>[](){function}<LSEP>[](pairlist){}<LSEP>[](symbol){mat}<LSEP>[](symbol){...}<LEND>[body; block](){}<LSEP>[statement 0; assign](){<-}<LSEP>[](symbol){mins}<LEND>[call](){}<LSEP>[](symbol){sprintf}<LSEP>[argument 0; litteral](str){:%02d}<LEND>[argument 1; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){0.000000}<LSEP>[argument 1; litteral](real){59.000000}<LEND>[statement 1; assign](){<-}<LSEP>[](symbol){x_labels}<LEND>[call](){}<LSEP>[](symbol){c}<LEND>[argument 0; call](){}<LSEP>[](symbol){paste0}<LSEP>[argument 0; litteral](real){12.000000}<LSEP>[](symbol){mins}<LSEP>[argument 2; litteral](str){ am}<LEND>[argument 1; call](){}<LSEP>[](symbol){sapply}<LEND>[argument 0; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){1.000000}<LSEP>[argument 1; litteral](real){11.000000}<LEND>[](symbol){paste0}<LSEP>[](symbol){mins}<LSEP>[argument 3; litteral](str){ am}<LEND>[argument 2; call](){}<LSEP>[](symbol){paste0}<LSEP>[argument 0; litteral](real){12.000000}<LSEP>[](symbol){mins}<LSEP>[argument 2; litteral](str){ pm}<LEND>[argument 3; call](){}<LSEP>[](symbol){sapply}<LEND>[argument 0; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){1.000000}<LSEP>[argument 1; litteral](real){11.000000}<LEND>[](symbol){paste0}<LSEP>[](symbol){mins}<LSEP>[argument 3; litteral](str){ pm}<LEND>[argument 4; litteral](str){12:00 am }<LEND>[statement 2; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){plot_ly}<LEND>[argument 0; call](){}<LSEP>[](symbol){factor}<LSEP>[](symbol){x_labels}<LEND>[argument 1; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){x_labels}<LEND>[argument 1; call](){}<LSEP>[](symbol){-}<LSEP>[argument 0; litteral](real){1441.000000}<LEND>[](symbol){mat}<LSEP>[argument 2; litteral](real){900.000000}<LSEP>[argument 3; litteral](real){450.000000}<LEND>[argument 4; call](){}<LSEP>[call name; call](){}<LSEP>[](symbol){colorRampPalette}<LEND>[argument 0; call](){}<LSEP>[](symbol){brewer.pal}<LSEP>[argument 0; litteral](real){9.000000}<LSEP>[argument 1; litteral](str){YlOrRd}<LEND>[argument 0; litteral](real){100.000000}<LEND>[argument 5; litteral](str){heatmap}<LEND>[argument 1; call](){}<LSEP>[](symbol){layout}<LEND>[argument 0; call](){}<LSEP>[](symbol){list}<LSEP>[argument 0; litteral](real){90.000000}<LSEP>[argument 1; litteral](real){90.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){list}<LSEP>[argument 0; litteral](logical){TRUE}<LSEP>[argument 1; litteral](str){}<LSEP>[argument 2; litteral](str){array}<LSEP>[argument 3; litteral](logical){TRUE}<LEND>[argument 4; call](){}<LSEP>[](symbol){:}<LSEP>[argument 0; litteral](real){0.000000}<LSEP>[argument 1; litteral](real){6.000000}<LEND>[argument 5; call](){}<LSEP>[](symbol){rev}<LEND>[argument 0; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){Monday}<LSEP>[argument 1; litteral](str){Tuesday}<LSEP>[argument 2; litteral](str){Wednesday}<LSEP>[argument 3; litteral](str){Thursday}<LSEP>[argument 4; litteral](str){Friday}<LSEP>[argument 5; litteral](str){Saturday}<LSEP>[argument 6; litteral](str){Sunday}<LEND>[argument 2; call](){}<LSEP>[](symbol){list}<LSEP>[argument 0; litteral](logical){TRUE}<LSEP>[argument 1; litteral](real){45.000000}<LSEP>[argument 2; litteral](str){array}<LEND>[argument 3; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){x_labels}<LEND>[argument 1; call](){}<LSEP>[](symbol){seq}<LSEP>[argument 0; litteral](real){1.000000}<LSEP>[argument 1; litteral](real){1441.000000}<LSEP>[argument 2; litteral](real){60.000000}<LEND>[argument 4; call](){}<LSEP>[](symbol){gsub}<LSEP>[argument 0; litteral](str){:00}<LSEP>[argument 1; litteral](str){}<LEND>[argument 2; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){x_labels}<LEND>[argument 1; call](){}<LSEP>[](symbol){seq}<LSEP>[argument 0; litteral](real){1.000000}<LSEP>[argument 1; litteral](real){1441.000000}<LSEP>[argument 2; litteral](real){60.000000}<LEND>[](symbol){...}<LEND>[argument 1; call](){}<LSEP>[](symbol){colorbar}<LSEP>[argument 0; litteral](str){}<LSEP>[argument 1; litteral](str){Demand}<LEND>[argument 2; call](){}<LSEP>[](symbol){list}<LSEP>[argument 0; litteral](real){14.000000}<LEND>[argument 3; litteral](str){array}<LEND>[argument 4; call](){}<LSEP>[](symbol){seq}<LEND>[argument 0; call](){}<LSEP>[](symbol){min}<LSEP>[](symbol){mat}<LEND>[argument 1; litteral](real){1.000000}<LSEP>[argument 2; litteral](real){3.000000}<LEND>[argument 5; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){ low}<LSEP>[argument 1; litteral](str){ med}<LSEP>[argument 2; litteral](str){ high}<LEND>[assign](){<-}<LSEP>[](symbol){d}<LEND>[call](){}<LSEP>[](symbol){densityCalc}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){pickup_datetime}<LEND>[call](){}<LSEP>[](symbol){heat_ly}<LSEP>[](symbol){d}<LSEP>[argument 1; litteral](str){Pickup Demand}<LEND>[assign](){<-}<LSEP>[](symbol){d}<LEND>[call](){}<LSEP>[](symbol){densityCalc}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){dropoff_datetime}<LEND>[call](){}<LSEP>[](symbol){heat_ly}<LSEP>[](symbol){d}<LSEP>[argument 1; litteral](str){Dropoff Demand}<LEND>[call](){}<LSEP>[](symbol){rm}<LEND>[argument 0; call](){}<LSEP>[](symbol){setdiff}<LEND>[argument 0; call](){}<LSEP>[](symbol){ls}<LEND>[argument 1; litteral](str){train}<LEND>[call](){}<LSEP>[](symbol){gc}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){train}<LEND>[argument 1; call](){}<LSEP>[](symbol){>}<LSEP>[](symbol){trip_duration}<LEND>[argument 1; call](){}<LSEP>[](symbol){/}<LSEP>[argument 0; litteral](real){30.000000}<LSEP>[argument 1; litteral](real){60.000000}<LEND>[argument 2; call](){}<LSEP>[](symbol){:=}<LSEP>[](symbol){trip_type}<LSEP>[argument 1; litteral](str){t > 30}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){train}<LEND>[argument 1; call](){}<LSEP>[](symbol){between}<LSEP>[](symbol){trip_duration}<LEND>[argument 1; call](){}<LSEP>[](symbol){/}<LSEP>[argument 0; litteral](real){0.000000}<LSEP>[argument 1; litteral](real){60.000000}<LEND>[argument 2; call](){}<LSEP>[](symbol){/}<LSEP>[argument 0; litteral](real){5.000000}<LSEP>[argument 1; litteral](real){60.000000}<LEND>[argument 2; call](){}<LSEP>[](symbol){:=}<LSEP>[](symbol){trip_type}<LSEP>[argument 1; litteral](str){t < 5}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){train}<LEND>[argument 1; call](){}<LSEP>[](symbol){between}<LSEP>[](symbol){trip_duration}<LEND>[argument 1; call](){}<LSEP>[](symbol){/}<LSEP>[argument 0; litteral](real){5.000000}<LSEP>[argument 1; litteral](real){60.000000}<LEND>[argument 2; call](){}<LSEP>[](symbol){/}<LSEP>[argument 0; litteral](real){10.000000}<LSEP>[argument 1; litteral](real){60.000000}<LEND>[argument 2; call](){}<LSEP>[](symbol){:=}<LSEP>[](symbol){trip_type}<LSEP>[argument 1; litteral](str){t in [5, 15)}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){train}<LEND>[argument 1; call](){}<LSEP>[](symbol){between}<LSEP>[](symbol){trip_duration}<LEND>[argument 1; call](){}<LSEP>[](symbol){/}<LSEP>[argument 0; litteral](real){10.000000}<LSEP>[argument 1; litteral](real){60.000000}<LEND>[argument 2; call](){}<LSEP>[](symbol){/}<LSEP>[argument 0; litteral](real){30.000000}<LSEP>[argument 1; litteral](real){60.000000}<LEND>[argument 2; call](){}<LSEP>[](symbol){:=}<LSEP>[](symbol){trip_type}<LSEP>[argument 1; litteral](str){t in [15, 30)}<LEND>[assign](){<-}<LSEP>[](symbol){equalize}<LEND>[](){function}<LSEP>[](pairlist){}<LSEP>[](symbol){x}<LEND>[body; block](){}<LSEP>[statement 0; assign](){<-}<LSEP>[](symbol){h}<LEND>[call](){}<LSEP>[](symbol){histeq}<LSEP>[](symbol){x}<LEND>[statement 1; call](){}<LSEP>[](symbol){/}<LEND>[argument 0; call](){}<LSEP>[](symbol){(}<LEND>[argument 0; call](){}<LSEP>[](symbol){-}<LSEP>[](symbol){h}<LEND>[argument 1; call](){}<LSEP>[](symbol){min}<LSEP>[](symbol){h}<LEND>[argument 1; call](){}<LSEP>[](symbol){(}<LEND>[argument 0; call](){}<LSEP>[](symbol){-}<LEND>[argument 0; call](){}<LSEP>[](symbol){max}<LSEP>[](symbol){h}<LEND>[argument 1; call](){}<LSEP>[](symbol){min}<LSEP>[](symbol){h}<LEND>[assign](){<-}<LSEP>[](symbol){shade}<LEND>[](){function}<LSEP>[](pairlist){}<LSEP>[](symbol){x}<LEND>[body; call](){}<LSEP>[call name; call](){}<LSEP>[](symbol){colorNumeric}<LEND>[argument 0; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){blue}<LSEP>[argument 1; litteral](str){red}<LEND>[argument 1; call](){}<LSEP>[](symbol){seq}<LSEP>[argument 0; litteral](real){0.000000}<LSEP>[argument 1; litteral](real){1.000000}<LSEP>[argument 2; litteral](real){0.010000}<LEND>[argument 0; call](){}<LSEP>[](symbol){equalize}<LSEP>[](symbol){x}<LEND>[assign](){<-}<LSEP>[](symbol){colors}<LEND>[call](){}<LSEP>[](symbol){setNames}<LEND>[argument 0; call](){}<LSEP>[](symbol){paste0}<LEND>[argument 0; call](){}<LSEP>[](symbol){shade}<LEND>[argument 0; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](real){0.000000}<LSEP>[argument 1; litteral](real){0.250000}<LSEP>[argument 2; litteral](real){0.500000}<LSEP>[argument 3; litteral](real){1.000000}<LEND>[argument 1; litteral](str){25}<LEND>[argument 1; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){t < 5}<LSEP>[argument 1; litteral](str){t in [5, 15)}<LSEP>[argument 2; litteral](str){t in [15, 30)}<LSEP>[argument 3; litteral](str){t > 30}<LEND>[assign](){<-}<LSEP>[](symbol){trips}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){train}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){.}<LEND>[argument 0; call](){}<LSEP>[](symbol){c}<LSEP>[](symbol){pickup_latitude}<LSEP>[](symbol){dropoff_latitude}<LEND>[argument 1; call](){}<LSEP>[](symbol){c}<LSEP>[](symbol){pickup_longitude}<LSEP>[](symbol){dropoff_longitude}<LEND>[argument 2; call](){}<LSEP>[](symbol){c}<LSEP>[](symbol){trip_duration}<LSEP>[](symbol){trip_duration}<LEND>[](symbol){trip_type}<LEND>[call](){}<LSEP>[](symbol){plot}<LSEP>[argument 0; litteral](real){0.000000}<LSEP>[argument 1; litteral](str){n}<LSEP>[argument 2; litteral](real){1.000000}<LSEP>[argument 3; litteral](str){Locations}<LEND>[argument 4; call](){}<LSEP>[](symbol){c}<LEND>[argument 0; call](){}<LSEP>[](symbol){-}<LSEP>[argument 0; litteral](real){74.030000}<LEND>[argument 1; call](){}<LSEP>[](symbol){-}<LSEP>[argument 0; litteral](real){73.930000}<LEND>[argument 5; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](real){40.700000}<LSEP>[argument 1; litteral](real){40.800000}<LEND>[argument 6; litteral](str){longitude}<LSEP>[argument 7; litteral](str){latitude}<LEND>[control flow](){for}<LSEP>[](symbol){cls}<LEND>[range; call](){}<LSEP>[](symbol){names}<LSEP>[](symbol){colors}<LEND>[body; call](){}<LSEP>[](symbol){with}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){trips}<LEND>[argument 1; call](){}<LSEP>[](symbol){sample}<LSEP>[](symbol){.N}<LSEP>[argument 1; litteral](real){25000.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){points}<LSEP>[](symbol){lon}<LSEP>[](symbol){lat}<LSEP>[argument 2; litteral](real){16.000000}<LEND>[argument 3; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){colors}<LSEP>[](symbol){cls}<LEND>[argument 4; litteral](real){0.250000}<LEND>[call](){}<LSEP>[](symbol){rm}<LEND>[argument 0; call](){}<LSEP>[](symbol){setdiff}<LEND>[argument 0; call](){}<LSEP>[](symbol){ls}<LEND>[argument 1; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){train}<LSEP>[argument 1; litteral](str){equalize}<LSEP>[argument 2; litteral](str){shade}<LEND>[call](){}<LSEP>[](symbol){gc}<LEND>[assign](){<-}<LSEP>[](symbol){formatted}<LEND>[call](){}<LSEP>[](symbol){copy}<LSEP>[](symbol){train}<LEND>[assign](){<-}<LSEP>[](symbol){extractTime}<LEND>[](){function}<LSEP>[](pairlist){}<LSEP>[](symbol){t}<LEND>[body; block](){}<LSEP>[statement 0; assign](){<-}<LSEP>[](symbol){t}<LEND>[call](){}<LSEP>[](symbol){ymd_hms}<LSEP>[](symbol){t}<LEND>[statement 1; assign](){<-}<LSEP>[](symbol){h}<LEND>[call](){}<LSEP>[](symbol){hour}<LSEP>[](symbol){t}<LEND>[statement 2; assign](){<-}<LSEP>[](symbol){m}<LEND>[call](){}<LSEP>[](symbol){minute}<LSEP>[](symbol){t}<LEND>[statement 3; call](){}<LSEP>[](symbol){sprintf}<LSEP>[argument 0; litteral](str){%d:%02d %s}<LSEP>[](symbol){h}<LSEP>[](symbol){m}<LEND>[argument 3; call](){}<LSEP>[](symbol){ifelse}<LEND>[argument 0; call](){}<LSEP>[](symbol){>}<LSEP>[](symbol){h}<LSEP>[argument 1; litteral](real){12.000000}<LEND>[argument 1; litteral](str){pm}<LSEP>[argument 2; litteral](str){am}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){formatted}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){:=}<LSEP>[](symbol){pickup_datetime}<LEND>[argument 1; call](){}<LSEP>[](symbol){extractTime}<LSEP>[](symbol){pickup_datetime}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){formatted}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){:=}<LSEP>[](symbol){dropoff_datetime}<LEND>[argument 1; call](){}<LSEP>[](symbol){extractTime}<LSEP>[](symbol){dropoff_datetime}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){formatted}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){:=}<LSEP>[](symbol){trip_duration}<LEND>[argument 1; call](){}<LSEP>[](symbol){sprintf}<LSEP>[argument 0; litteral](str){%0.2f mins}<LEND>[argument 1; call](){}<LSEP>[](symbol){*}<LSEP>[](symbol){trip_duration}<LSEP>[argument 1; litteral](real){60.000000}<LEND>[assign](){<-}<LSEP>[](symbol){center_lon}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){train}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){median}<LEND>[argument 0; call](){}<LSEP>[](symbol){c}<LSEP>[](symbol){pickup_longitude}<LSEP>[](symbol){dropoff_longitude}<LEND>[assign](){<-}<LSEP>[](symbol){center_lat}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){train}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){median}<LEND>[argument 0; call](){}<LSEP>[](symbol){c}<LSEP>[](symbol){pickup_latitude}<LSEP>[](symbol){dropoff_latitude}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){formatted}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){:=}<LSEP>[](symbol){trip_distance}<LEND>[argument 1; call](){}<LSEP>[](symbol){distGeo}<LEND>[argument 0; call](){}<LSEP>[](symbol){cbind}<LSEP>[](symbol){pickup_longitude}<LSEP>[](symbol){pickup_latitude}<LEND>[argument 1; call](){}<LSEP>[](symbol){cbind}<LSEP>[](symbol){dropoff_longitude}<LSEP>[](symbol){dropoff_latitude}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){formatted}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){:=}<LSEP>[](symbol){trip_distance}<LEND>[argument 1; call](){}<LSEP>[](symbol){sprintf}<LSEP>[argument 0; litteral](str){%0.2f m}<LSEP>[](symbol){trip_distance}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){formatted}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){:=}<LSEP>[](symbol){pickup_location}<LEND>[argument 1; call](){}<LSEP>[](symbol){sprintf}<LSEP>[argument 0; litteral](str){(%0.3f, %0.3f)}<LSEP>[](symbol){pickup_latitude}<LSEP>[](symbol){pickup_longitude}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){formatted}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){:=}<LSEP>[](symbol){dropoff_location}<LEND>[argument 1; call](){}<LSEP>[](symbol){sprintf}<LSEP>[argument 0; litteral](str){(%0.3f, %0.3f)}<LSEP>[](symbol){dropoff_latitude}<LSEP>[](symbol){dropoff_longitude}<LEND>[assign](){<-}<LSEP>[](symbol){info_cols}<LEND>[call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){id}<LSEP>[argument 1; litteral](str){vendor_id}<LSEP>[argument 2; litteral](str){pickup_location}<LSEP>[argument 3; litteral](str){dropoff_location}<LSEP>[argument 4; litteral](str){trip_distance}<LSEP>[argument 5; litteral](str){passenger_count}<LSEP>[argument 6; litteral](str){pickup_datetime}<LSEP>[argument 7; litteral](str){dropoff_datetime}<LSEP>[argument 8; litteral](str){trip_duration}<LEND>[assign](){<-}<LSEP>[](symbol){addLabel}<LEND>[](){function}<LSEP>[](pairlist){}<LSEP>[](symbol){j}<LEND>[body; call](){}<LSEP>[](symbol){sprintf}<LSEP>[argument 0; litteral](str){<b>%s</b>: %s <br/>}<LSEP>[](symbol){j}<LEND>[argument 2; call](){}<LSEP>[](symbol){[[}<LSEP>[](symbol){formatted}<LSEP>[](symbol){j}<LEND>[assign](){<-}<LSEP>[](symbol){labels}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){formatted}<LSEP>[](symbol){}<LEND>[argument 2; call](){}<LSEP>[](symbol){lapply}<LSEP>[](symbol){info_cols}<LSEP>[](symbol){addLabel}<LEND>[call](){}<LSEP>[](symbol){set}<LSEP>[](symbol){train}<LSEP>[argument 1; litteral](str){info}<LEND>[argument 2; call](){}<LSEP>[](symbol){apply}<LSEP>[](symbol){labels}<LSEP>[argument 1; litteral](real){1.000000}<LSEP>[](symbol){paste}<LSEP>[argument 3; litteral](str){}<LEND>[call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){leaflet}<LEND>[argument 0; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){train}<LEND>[argument 1; call](){}<LSEP>[](symbol){sample}<LSEP>[](symbol){.N}<LSEP>[argument 1; litteral](real){250.000000}<LEND>[argument 1; litteral](str){100%}<LEND>[argument 1; call](){}<LSEP>[](symbol){addProviderTiles}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){providers}<LSEP>[](symbol){MtbMap}<LEND>[argument 1; call](){}<LSEP>[](symbol){addProviderTiles}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){providers}<LSEP>[](symbol){Stamen.TonerLines}<LEND>[argument 1; call](){}<LSEP>[](symbol){providerTileOptions}<LSEP>[argument 0; litteral](real){0.350000}<LEND>[argument 1; call](){}<LSEP>[](symbol){addProviderTiles}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){providers}<LSEP>[](symbol){Stamen.TonerLabels}<LEND>[argument 1; call](){}<LSEP>[](symbol){addScaleBar}<LEND>[argument 1; call](){}<LSEP>[](symbol){addCircles}<LEND>[argument 0; call](){}<LSEP>[](symbol){~}<LSEP>[](symbol){pickup_longitude}<LEND>[argument 1; call](){}<LSEP>[](symbol){~}<LSEP>[](symbol){pickup_latitude}<LEND>[argument 2; call](){}<LSEP>[](symbol){~}<LEND>[argument 0; call](){}<LSEP>[](symbol){*}<LSEP>[argument 0; litteral](real){10.000000}<LSEP>[](symbol){passenger_count}<LEND>[argument 3; litteral](real){0.750000}<LSEP>[argument 4; litteral](logical){FALSE}<LEND>[argument 5; call](){}<LSEP>[](symbol){~}<LEND>[argument 0; call](){}<LSEP>[](symbol){shade}<LSEP>[](symbol){trip_duration}<LEND>[argument 6; call](){}<LSEP>[](symbol){~}<LSEP>[](symbol){info}<LEND>[argument 7; litteral](str){Pickups}<LEND>[argument 1; call](){}<LSEP>[](symbol){addCircles}<LEND>[argument 0; call](){}<LSEP>[](symbol){~}<LSEP>[](symbol){dropoff_longitude}<LEND>[argument 1; call](){}<LSEP>[](symbol){~}<LSEP>[](symbol){dropoff_latitude}<LEND>[argument 2; call](){}<LSEP>[](symbol){~}<LEND>[argument 0; call](){}<LSEP>[](symbol){*}<LSEP>[argument 0; litteral](real){10.000000}<LSEP>[](symbol){passenger_count}<LEND>[argument 3; litteral](real){0.750000}<LSEP>[argument 4; litteral](logical){FALSE}<LEND>[argument 5; call](){}<LSEP>[](symbol){~}<LEND>[argument 0; call](){}<LSEP>[](symbol){shade}<LSEP>[](symbol){trip_duration}<LEND>[argument 6; call](){}<LSEP>[](symbol){~}<LSEP>[](symbol){info}<LEND>[argument 7; litteral](str){Dropoffs}<LEND>[argument 1; call](){}<LSEP>[](symbol){setView}<LSEP>[](symbol){center_lon}<LSEP>[](symbol){center_lat}<LSEP>[argument 2; litteral](real){15.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){addLayersControl}<LEND>[argument 0; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){Pickups}<LSEP>[argument 1; litteral](str){Dropoffs}<LEND>[argument 1; call](){}<LSEP>[](symbol){layersControlOptions}<LSEP>[argument 0; litteral](logical){FALSE}<LEND>[call](){}<LSEP>[](symbol){rm}<LEND>[argument 0; call](){}<LSEP>[](symbol){setdiff}<LEND>[argument 0; call](){}<LSEP>[](symbol){ls}<LEND>[argument 1; litteral](str){train}<LEND>[call](){}<LSEP>[](symbol){gc} |
[](){expression}<LSEP>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){ggplot2}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){randomForest}<LEND>[call](){}<LSEP>[](symbol){set.seed}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[](symbol){train}<LEND>[call](){}<LSEP>[](symbol){read.csv}<LSEP>[argument 0; litteral](str){../input/train.csv}<LSEP>[argument 1; litteral](logical){FALSE}<LEND>[assign](){<-}<LSEP>[](symbol){test}<LEND>[call](){}<LSEP>[](symbol){read.csv}<LSEP>[argument 0; litteral](str){../input/test.csv}<LSEP>[argument 1; litteral](logical){FALSE}<LEND>[assign](){<-}<LSEP>[](symbol){extractFeatures}<LEND>[](){function}<LSEP>[](pairlist){}<LSEP>[](symbol){data}<LEND>[body; block](){}<LSEP>[statement 0; assign](){<-}<LSEP>[](symbol){features}<LEND>[call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){Pclass}<LSEP>[argument 1; litteral](str){Age}<LSEP>[argument 2; litteral](str){Sex}<LSEP>[argument 3; litteral](str){Parch}<LSEP>[argument 4; litteral](str){SibSp}<LSEP>[argument 5; litteral](str){Fare}<LSEP>[argument 6; litteral](str){Embarked}<LEND>[statement 1; assign](){<-}<LSEP>[](symbol){fea}<LEND>[call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){data}<LSEP>[](symbol){}<LSEP>[](symbol){features}<LEND>[statement 2; assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fea}<LSEP>[](symbol){Age}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fea}<LSEP>[](symbol){Age}<LEND>[call](){}<LSEP>[](symbol){-}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[statement 3; assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fea}<LSEP>[](symbol){Fare}<LEND>[argument 1; call](){}<LSEP>[](symbol){is.na}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fea}<LSEP>[](symbol){Fare}<LEND>[call](){}<LSEP>[](symbol){median}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fea}<LSEP>[](symbol){Fare}<LEND>[argument 1; litteral](logical){TRUE}<LEND>[statement 4; assign](){=}<LSEP>[variable; call](){}<LSEP>[](symbol){[}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fea}<LSEP>[](symbol){Embarked}<LEND>[argument 1; call](){}<LSEP>[](symbol){==}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fea}<LSEP>[](symbol){Embarked}<LEND>[argument 1; litteral](str){}<LEND>[litteral](str){S}<LEND>[statement 5; assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fea}<LSEP>[](symbol){Sex}<LEND>[call](){}<LSEP>[](symbol){as.factor}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fea}<LSEP>[](symbol){Sex}<LEND>[statement 6; assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fea}<LSEP>[](symbol){Embarked}<LEND>[call](){}<LSEP>[](symbol){as.factor}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){fea}<LSEP>[](symbol){Embarked}<LEND>[statement 7; call](){}<LSEP>[](symbol){return}<LSEP>[](symbol){fea}<LEND>[assign](){<-}<LSEP>[](symbol){rf}<LEND>[call](){}<LSEP>[](symbol){randomForest}<LEND>[argument 0; call](){}<LSEP>[](symbol){extractFeatures}<LSEP>[](symbol){train}<LEND>[argument 1; call](){}<LSEP>[](symbol){as.factor}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){train}<LSEP>[](symbol){Survived}<LEND>[argument 2; litteral](real){100.000000}<LSEP>[argument 3; litteral](logical){TRUE}<LEND>[assign](){<-}<LSEP>[](symbol){submission}<LEND>[call](){}<LSEP>[](symbol){data.frame}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){test}<LSEP>[](symbol){PassengerId}<LEND>[assign](){<-}<LSEP>[variable; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){submission}<LSEP>[](symbol){Survived}<LEND>[call](){}<LSEP>[](symbol){predict}<LSEP>[](symbol){rf}<LEND>[argument 1; call](){}<LSEP>[](symbol){extractFeatures}<LSEP>[](symbol){test}<LEND>[call](){}<LSEP>[](symbol){write.csv}<LSEP>[](symbol){submission}<LSEP>[argument 1; litteral](str){1_random_forest_r_submission.csv}<LSEP>[argument 2; litteral](logical){FALSE}<LEND>[assign](){<-}<LSEP>[](symbol){imp}<LEND>[call](){}<LSEP>[](symbol){importance}<LSEP>[](symbol){rf}<LSEP>[argument 1; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[](symbol){featureImportance}<LEND>[call](){}<LSEP>[](symbol){data.frame}<LEND>[argument 0; call](){}<LSEP>[](symbol){row.names}<LSEP>[](symbol){imp}<LEND>[argument 1; call](){}<LSEP>[](symbol){[}<LSEP>[](symbol){imp}<LSEP>[](symbol){}<LSEP>[argument 2; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[](symbol){p}<LEND>[call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){ggplot}<LSEP>[](symbol){featureImportance}<LEND>[argument 1; call](){}<LSEP>[](symbol){aes}<LEND>[argument 0; call](){}<LSEP>[](symbol){reorder}<LSEP>[](symbol){Feature}<LSEP>[](symbol){Importance}<LEND>[](symbol){Importance}<LEND>[argument 1; call](){}<LSEP>[](symbol){geom_bar}<LSEP>[argument 0; litteral](str){identity}<LSEP>[argument 1; litteral](str){#53cfff}<LEND>[argument 1; call](){}<LSEP>[](symbol){coord_flip}<LEND>[argument 1; call](){}<LSEP>[](symbol){theme_light}<LSEP>[argument 0; litteral](real){20.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){xlab}<LSEP>[argument 0; litteral](str){}<LEND>[argument 1; call](){}<LSEP>[](symbol){ylab}<LSEP>[argument 0; litteral](str){Importance}<LEND>[argument 1; call](){}<LSEP>[](symbol){ggtitle}<LSEP>[argument 0; litteral](str){Random Forest Feature Importan...}<LEND>[argument 1; call](){}<LSEP>[](symbol){theme}<LEND>[argument 0; call](){}<LSEP>[](symbol){element_text}<LSEP>[argument 0; litteral](real){18.000000}<LEND>[call](){}<LSEP>[](symbol){ggsave}<LSEP>[argument 0; litteral](str){2_feature_importance.png}<LSEP>[](symbol){p} |
[](){expression}<LSEP>[call](){}<LSEP>[call name; call](){}<LSEP>[](symbol){$}<LEND>[argument 0; call](){}<LSEP>[](symbol){::}<LSEP>[](symbol){knitr}<LSEP>[](symbol){opts_chunk}<LEND>[](symbol){set}<LEND>[argument 0; litteral](logical){TRUE}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){tidyverse}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){lubridate}<LEND>[assign](){<-}<LSEP>[](symbol){taxi}<LEND>[call](){}<LSEP>[](symbol){read_csv}<LSEP>[argument 0; litteral](str){../input/train.csv}<LEND>[assign](){<-}<LSEP>[](symbol){taxi_submit}<LEND>[call](){}<LSEP>[](symbol){read_csv}<LSEP>[argument 0; litteral](str){../input/test.csv}<LEND>[call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){ggplot}<LSEP>[](symbol){taxi}<LEND>[argument 1; call](){}<LSEP>[](symbol){aes}<LEND>[argument 0; call](){}<LSEP>[](symbol){log}<LSEP>[](symbol){trip_duration}<LEND>[argument 1; call](){}<LSEP>[](symbol){geom_histogram}<LSEP>[argument 0; litteral](real){0.200000}<LEND>[call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LSEP>[](symbol){taxi}<LEND>[argument 1; call](){}<LSEP>[](symbol){filter}<LEND>[argument 0; call](){}<LSEP>[](symbol){>}<LEND>[argument 0; call](){}<LSEP>[](symbol){log}<LSEP>[](symbol){trip_duration}<LEND>[argument 1; litteral](real){10.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){arrange}<LEND>[argument 0; call](){}<LSEP>[](symbol){desc}<LSEP>[](symbol){trip_duration}<LEND>[argument 1; call](){}<LSEP>[](symbol){mutate}<LEND>[argument 0; call](){}<LSEP>[](symbol){/}<LSEP>[](symbol){trip_duration}<LSEP>[argument 1; litteral](real){3600.000000}<LEND>[call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LSEP>[](symbol){taxi}<LEND>[argument 1; call](){}<LSEP>[](symbol){filter}<LEND>[argument 0; call](){}<LSEP>[](symbol){<}<LSEP>[](symbol){trip_duration}<LSEP>[argument 1; litteral](real){2.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){arrange}<LSEP>[](symbol){trip_duration}<LEND>[assign](){<-}<LSEP>[](symbol){taxi}<LEND>[call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LSEP>[](symbol){taxi}<LEND>[argument 1; call](){}<LSEP>[](symbol){mutate}<LEND>[argument 0; call](){}<LSEP>[](symbol){-}<LSEP>[](symbol){dropoff_latitude}<LSEP>[](symbol){pickup_latitude}<LEND>[argument 1; call](){}<LSEP>[](symbol){-}<LSEP>[](symbol){dropoff_longitude}<LSEP>[](symbol){pickup_longitude}<LEND>[argument 1; call](){}<LSEP>[](symbol){mutate}<LEND>[argument 0; call](){}<LSEP>[](symbol){sqrt}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){^}<LSEP>[](symbol){latdiff}<LSEP>[argument 1; litteral](real){2.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){^}<LSEP>[](symbol){londiff}<LSEP>[argument 1; litteral](real){2.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){abs}<LSEP>[](symbol){latdiff}<LEND>[argument 1; call](){}<LSEP>[](symbol){abs}<LSEP>[](symbol){londiff}<LEND>[argument 1; call](){}<LSEP>[](symbol){select}<LEND>[argument 0; call](){}<LSEP>[](symbol){-}<LSEP>[](symbol){latdiff}<LEND>[argument 1; call](){}<LSEP>[](symbol){-}<LSEP>[](symbol){londiff}<LEND>[assign](){<-}<LSEP>[](symbol){taxi}<LEND>[call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LSEP>[](symbol){taxi}<LEND>[argument 1; call](){}<LSEP>[](symbol){mutate}<LEND>[argument 0; call](){}<LSEP>[](symbol){year}<LSEP>[](symbol){pickup_datetime}<LEND>[argument 1; call](){}<LSEP>[](symbol){month}<LSEP>[](symbol){pickup_datetime}<LSEP>[argument 1; litteral](logical){TRUE}<LEND>[argument 2; call](){}<LSEP>[](symbol){wday}<LSEP>[](symbol){pickup_datetime}<LSEP>[argument 1; litteral](logical){TRUE}<LEND>[argument 3; call](){}<LSEP>[](symbol){hour}<LSEP>[](symbol){pickup_datetime}<LEND>[argument 4; call](){}<LSEP>[](symbol){minute}<LSEP>[](symbol){pickup_datetime}<LEND>[argument 1; call](){}<LSEP>[](symbol){select}<LEND>[argument 0; call](){}<LSEP>[](symbol){-}<LSEP>[](symbol){pickup_datetime}<LEND>[argument 1; call](){}<LSEP>[](symbol){-}<LSEP>[](symbol){dropoff_datetime}<LEND>[call](){}<LSEP>[](symbol){unique}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){taxi}<LSEP>[](symbol){pickup_year}<LEND>[assign](){<-}<LSEP>[](symbol){taxi}<LEND>[call](){}<LSEP>[](symbol){select}<LSEP>[](symbol){taxi}<LEND>[argument 1; call](){}<LSEP>[](symbol){-}<LSEP>[](symbol){pickup_year}<LEND>[assign](){<-}<LSEP>[](symbol){taxi}<LEND>[call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LSEP>[](symbol){taxi}<LEND>[argument 1; call](){}<LSEP>[](symbol){mutate}<LEND>[argument 0; call](){}<LSEP>[](symbol){ifelse}<LEND>[argument 0; call](){}<LSEP>[](symbol){|}<LEND>[argument 0; call](){}<LSEP>[](symbol){between}<LSEP>[](symbol){pickup_hour}<LSEP>[argument 1; litteral](real){7.000000}<LSEP>[argument 2; litteral](real){9.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){between}<LSEP>[](symbol){pickup_hour}<LSEP>[argument 1; litteral](real){17.000000}<LSEP>[argument 2; litteral](real){19.000000}<LEND>[argument 1; litteral](str){Y}<LSEP>[argument 2; litteral](str){N}<LEND>[argument 1; call](){}<LSEP>[](symbol){mutate}<LEND>[argument 0; call](){}<LSEP>[](symbol){ifelse}<LEND>[argument 0; call](){}<LSEP>[](symbol){%in%}<LSEP>[](symbol){pickup_wday}<LEND>[argument 1; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](str){Sat}<LSEP>[argument 1; litteral](str){Sun}<LEND>[argument 1; litteral](str){Y}<LSEP>[argument 2; litteral](str){N}<LEND>[assign](){<-}<LSEP>[](symbol){taxi}<LEND>[call](){}<LSEP>[](symbol){mutate}<LSEP>[](symbol){taxi}<LEND>[argument 1; call](){}<LSEP>[](symbol){log}<LSEP>[](symbol){trip_duration}<LEND>[assign](){<-}<LSEP>[](symbol){taxi}<LEND>[call](){}<LSEP>[](symbol){mutate}<LSEP>[](symbol){taxi}<LEND>[argument 1; call](){}<LSEP>[](symbol){factor}<LSEP>[](symbol){vendor_id}<LEND>[argument 2; call](){}<LSEP>[](symbol){factor}<LSEP>[](symbol){store_and_fwd_flag}<LEND>[argument 3; call](){}<LSEP>[](symbol){factor}<LSEP>[](symbol){peak_hour}<LEND>[argument 4; call](){}<LSEP>[](symbol){factor}<LSEP>[](symbol){weekend}<LEND>[call](){}<LSEP>[](symbol){library}<LSEP>[](symbol){gbm}<LEND>[call](){}<LSEP>[](symbol){set.seed}<LSEP>[argument 0; litteral](real){1.000000}<LEND>[assign](){<-}<LSEP>[](symbol){train}<LEND>[call](){}<LSEP>[](symbol){sample_frac}<LSEP>[](symbol){taxi}<LSEP>[argument 1; litteral](real){0.800000}<LEND>[assign](){<-}<LSEP>[](symbol){test}<LEND>[call](){}<LSEP>[call name; call](){}<LSEP>[](symbol){::}<LSEP>[](symbol){dplyr}<LSEP>[](symbol){setdiff}<LEND>[](symbol){taxi}<LSEP>[](symbol){train}<LEND>[assign](){<-}<LSEP>[](symbol){boosted_mod}<LEND>[call](){}<LSEP>[](symbol){gbm}<LEND>[argument 0; call](){}<LSEP>[](symbol){~}<LSEP>[](symbol){trip_duration}<LEND>[argument 1; call](){}<LSEP>[](symbol){-}<LSEP>[](symbol){.}<LSEP>[](symbol){id}<LEND>[](symbol){train}<LSEP>[argument 2; litteral](real){0.001000}<LSEP>[argument 3; litteral](str){gaussian}<LSEP>[argument 4; litteral](real){1000.000000}<LSEP>[argument 5; litteral](real){0.010000}<LSEP>[argument 6; litteral](real){3.000000}<LEND>[assign](){<-}<LSEP>[](symbol){boosted_pred}<LEND>[call](){}<LSEP>[](symbol){predict}<LSEP>[](symbol){boosted_mod}<LSEP>[](symbol){test}<LSEP>[argument 2; litteral](real){1000.000000}<LEND>[assign](){<-}<LSEP>[](symbol){plt}<LEND>[call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){%>%}<LEND>[argument 0; call](){}<LSEP>[](symbol){tibble}<LEND>[argument 0; call](){}<LSEP>[](symbol){exp}<LEND>[argument 0; call](){}<LSEP>[](symbol){$}<LSEP>[](symbol){test}<LSEP>[](symbol){trip_duration}<LEND>[argument 1; call](){}<LSEP>[](symbol){exp}<LSEP>[](symbol){boosted_pred}<LEND>[argument 1; call](){}<LSEP>[](symbol){sample_n}<LSEP>[argument 0; litteral](real){2000.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){ggplot}<LEND>[argument 0; call](){}<LSEP>[](symbol){aes}<LSEP>[](symbol){true_duration}<LSEP>[](symbol){pred_duration}<LEND>[argument 1; call](){}<LSEP>[](symbol){geom_point}<LEND>[call](){}<LSEP>[](symbol){+}<LEND>[argument 0; call](){}<LSEP>[](symbol){+}<LSEP>[](symbol){plt}<LEND>[argument 1; call](){}<LSEP>[](symbol){coord_fixed}<LEND>[argument 0; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](real){0.000000}<LSEP>[argument 1; litteral](real){3000.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){c}<LSEP>[argument 0; litteral](real){0.000000}<LSEP>[argument 1; litteral](real){3000.000000}<LEND>[argument 1; call](){}<LSEP>[](symbol){geom_abline}<LSEP>[argument 0; litteral](str){red}<LSEP>[argument 1; litteral](real){1.000000}<LEND>[call](){}<LSEP>[](symbol){summary}<LSEP>[](symbol){boosted_mod} |
End of preview. Expand
in Dataset Viewer.
No dataset card yet
New: Create and edit this dataset card directly on the website!
Contribute a Dataset Card- Downloads last month
- 6