{"cells":[{"metadata":{"_uuid":"e82261f0eab029f72b89d70e3fe3eeb310b96a35","_execution_state":"idle","trusted":true},"cell_type":"code","source":"# init\nlibrary(tidyverse) # metapackage with lots of helpful functions\n\n# You can access files from datasets you've added to this kernel in the \"../input/\" directory.\n# You can see the files added to this kernel by running the code below. \n\nlist.files(path = \"../input\")\n","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"03e8fe2733c2d3f55525c4a9ea175b6510ec4c18"},"cell_type":"code","source":"# load training data\nlibrary(data.table)\nt1 <- Sys.time()\ndf.train <- fread(\"../input/train.csv\", sep=\",\")\nt2 <- Sys.time()\nprint(t2-t1)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"0e8e163e7904392bba6b9055af691e8f753f21f9"},"cell_type":"code","source":"# first look at (raw) data\nstr(df.train)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"d16d36ac8d44ee3430fe0c7f47bc7d90dc80ae19"},"cell_type":"code","source":"# convert chars to factor\ndf.train$experiment <- as.factor(df.train$experiment)\ndf.train$event <- as.factor(df.train$event)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"f41132a7728f11b92149c7558a64deab21b7bec6"},"cell_type":"code","source":"summary(df.train)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"d89209df38f0138ba37ab564b34b98f6ea056c95"},"cell_type":"code","source":"# plot target\nplot(df.train$event)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"8ce212288eafc3b63e39acc65ce31d86e44c4f38"},"cell_type":"code","source":"# load test data\nt1 <- Sys.time()\ndf.test <- fread(\"../input/test.csv\", sep=\",\")\nt2 <- Sys.time()\nprint(t2-t1)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"87e53819b84165ff8ee42329297b2ad66f94dfc7"},"cell_type":"code","source":"df.test$id <- as.factor(df.test$id)\ndf.test$experiment <- as.factor(df.test$experiment)\nstr(df.test)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"d0ffed173dec5462af5d43ee69254f96cfa35f1e"},"cell_type":"code","source":"# convert to data.frame\ndf.train <- as.data.frame(df.train)\ndf.test <- as.data.frame(df.test)\n\n# save to file\nsave(df.train, file='train_prep.RData')\nsave(df.test, file='test_prep.RData')","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"display_name":"R","language":"R","name":"ir"},"language_info":{"mimetype":"text/x-r-source","name":"R","pygments_lexer":"r","version":"3.4.2","file_extension":".r","codemirror_mode":"r"}},"nbformat":4,"nbformat_minor":1}