Skip to content

RMSEWithUncertainty Error "Non-multiregression compatible metric" for R #1438

@kransom14

Description

@kransom14

Problem: RMSEWithUncertainty Error "Non-multiregression compatible metric" for R
catboost version: 0.24.1
Operating System: Windows 10
CPU:

I am attempting to set up a simple regression example on the Boston Housing data set from mlbench, following this blog post: https://medium.com/ampersand-academy/how-to-create-regression-model-using-catboost-package-in-r-programming-6cce3805a5e1.

I'd like to try RMSEWithUncertainty as the loss function as release 0.24 says is now available. I receive the following error when attempting to train the model:

Error in catboost.get_feature_importance(model, learn_pool) :
c:/program files (x86)/go agent/pipelines/buildmaster/catboost.git/catboost/private/libs/target/data_providers.cpp:379: Non-Multiclassification and Non-Multiregression compatible metric (RMSEWithUncertainty) specified for a multidimensional model

library(catboost)
library(mlbench)


# attach the BostonHousing dataset
data(BostonHousing)

#caret library
library(caret)

# Split out validation dataset
# create a list of 80% of the rows in the original dataset we can use for training
set.seed(7)
validation_index <- createDataPartition(BostonHousing$medv, p=0.80, list=FALSE)

# select 20% of the data for validation
validation <- BostonHousing[-validation_index,]
# use the remaining 80% of data to training and testing the models
dataset <- BostonHousing[validation_index,]

# Separate x and y of train and test dataset, which will very useful when we using this in the catboost package.
library(dplyr)
y_train <- unlist(dataset[c('medv')])
X_train <- dataset %>% select(-medv)
y_valid <- unlist(validation[c('medv')])
X_valid <- validation %>% select(-medv)

#Convert the train and test dataset to catboost specific format using the load_pool function by mentioning x and y of both train and test.
train_pool <- catboost.load_pool(data = X_train, label = y_train)
test_pool <- catboost.load_pool(data = X_valid, label = y_valid)

# create list of params
params <- list(iterations=500,
               learning_rate=0.01,
               depth=10,
               loss_function='RMSEWithUncertainty')

model_u <- catboost.train(learn_pool = train_pool,params = params)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions