# fread is much faster than read_csv or read.csv 
# and is really helpful for this comp where we have a huge dataset

library(data.table)

start.time = Sys.time()
train <- fread('../input/train.csv', 
select = c("Semana","Agencia_ID","Canal_ID","Ruta_SAK","Cliente_ID","Producto_ID","Venta_uni_hoy","Dev_uni_proxima"),
colClasses = c(Semana="numeric",Agencia_ID="numeric",Canal_ID="numeric",Ruta_SAK="numeric",Cliente_ID="numeric",Producto_ID="numeric",Venta_uni_hoy="numeric",Dev_uni_proxima="numeric"))

print("Training data set loaded")
print((Sys.time()-start.time))
 
start.time = Sys.time()
test <- fread('../input/test.csv', 
select = c("id","Semana","Agencia_ID","Canal_ID","Ruta_SAK","Cliente_ID","Producto_ID"),
colClasses = c(Semana="numeric",Agencia_ID="numeric",Canal_ID="numeric",Ruta_SAK="numeric",Cliente_ID="numeric",Producto_ID="numeric"))

print("Test data set loaded")
print((Sys.time()-start.time))

#Cautioh: You may later need to coerce your data frame to data.frame 
#as it inherits them as data.table too