[R Ubuntu]: catboost.caret
System: Ubuntu 14.04 LTS Processor: Intel® Core™ i3-6100 CPU @ 3.70GHz × 4 Graphics: Intel® HD Graphics 530 (Skylake GT2) OS type: 64-bit R: 3.4.1 Python: 3.4.3
Issue with using the catboost package through the caret package. Simplified example from https://tech.yandex.com/catboost/doc/dg/concepts/r-usages-examples-docpage/
library(caret)
library(titanic)
library(catboost)
set.seed(12345)
data <- as.data.frame(as.matrix(titanic_train), stringsAsFactors = TRUE)
drop_columns = c("PassengerId", "Survived", "Name", "Ticket", "Cabin")
x <- data[, !(names(data) %in% drop_columns)]
y <- data[, c("Survived")]
report <- train(x, as.factor(make.names(y)), method = catboost.caret)
Output:
Something is wrong; all the Accuracy metric values are missing: Accuracy Kappa
Min. : NA Min. : NA
1st Qu.: NA 1st Qu.: NA
Median : NA Median : NA
Mean :NaN Mean :NaN
3rd Qu.: NA 3rd Qu.: NA
Max. : NA Max. : NA
NA's :12 NA's :12
Error: Stopping In addition: Warning message: In nominalTrainWorkflow(x = x, y = y, wts = weights, info = trainInfo, : There were missing values in resampled performance measures.
@OlehYashchuk: I think you have stumbled into a non-catboost issue. Using report <- train(x, as.factor(make.names(y)), method = 'rf') does produce NA values too, so clearly this is not catboost specific. I would recommend using the formula interface on first instance.
@hadjipantelis thank you for your attention. Using of the formula interface really fixed the issue.
The following code works perfectly
library(caret)
library(titanic)
library(catboost)
set.seed(12345)
data <- as.data.frame(as.matrix(titanic_train), stringsAsFactors = TRUE)
drop_columns = c("PassengerId", "Survived", "Name", "Ticket", "Cabin", "Age")
x <- data[, !(names(data) %in% drop_columns)]
y <- data[, c("Survived")]
x.train <- cbind(as.factor(make.names(y)), x)
setnames(x.train, "as.factor(make.names(y))", "y")
report <- train(y~., data = x.train, method = catboost.caret)