following is a piece of code that I am implementing:
train.data <- data.frame(cbind(all[1:end_trn,-1],Response))
#model building
train.task <- makeClassifTask(data = train.data[1:round(end_trn*train.fact),], target = "Response")
test.task <- makeClassifTask(data = train.data[(round(end_trn*train.fact)+1):end_trn,], target = "Response")
lrn = makeLearner("classif.xgboost")
lrn$par.vals = list(nrounds = 10,
print.every.n = 5,
objective = "multi:softmax",
#num_class = 9,
depth = 4,
eta = 0.05,
colsample_bytree = 0.66,
min_child_weight = 4,
subsample = 0.91)
model <- train(lrn, train.task)
pred <- predict(model, train.task)
while executing last command of the code I face the following error:
Error in data.frame(id = 1:47505, truth = c(8L, 4L, 8L, 8L, 8L, 8L, 8L, :
arguments imply differing number of rows: 47505, 5938
I ran the same script for a simple case of iris data and it is running fine. What does the "arguments imply differing number of rows: 47505, 5938" means? training set has 47505 rows, what 5938 indicates? *The library used is 'mlr'
Thanks in advance,