#Setting a temporal directory as a working directory
if (FALSE) wd<-tempdir()
if (FALSE) setwd(wd)
#Building the model
my.grid=list(eta=c(0.01,0.02,0.05),subsample=c(0.5,0.8))
data_train<-dplyr::filter(dataCOICOP,dataCOICOP$time<=as.Date("2021-10-01"))
data_test<-dplyr::filter(dataCOICOP,dataCOICOP$time==as.Date("2021-11-01"))
ML<-model_classification(data_train,data_test,class="coicop6",grid=my.grid,
indicators=c("description","codeIN", "grammage"),key_words=c("uht"),rounds=60)
#Saving the model
if (FALSE) save_model(ML, dir="My_model")
#Loading the model
if (FALSE) ML_fromPC<-load_model("My_model")
#classes predicting
if (FALSE) data_classifying(ML_fromPC, data_test)
Run the code above in your browser using DataLab