data_classifying {PriceIndices} | R Documentation |
Predicting product classes via the machine learning model
Description
This function predicts product class levels via the selected machine learning model.
Usage
data_classifying(model = list(), data)
Arguments
model |
A list of 8 elements which identify the previously built machine learning model (the list is obtained via the |
data |
A data set for the model (products with their characteristics). This data set must contain all the columns which were used in the built model. |
Value
This function provides the indicated data set with an additional column, i.e. class_predicted
, which is obtained by using the selected machine learning model.
Examples
#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)
#Data classification
data_classifying(ML, data_test)
[Package PriceIndices version 0.1.9 Index]