3

I want to find optimal parameters for doing classification using Catboost. I have training data and test data. I want to run the algorithm for say 500 iterations and then make predictions on test data. Next, I want to repeat this for 600 iterations and then 700 iterations and so on. I don't want to start from iteration 0 again. So, is there any way I can do this in Catboost algorithm?

Any help is highly appreciated!

Rozen Moon
  • 103
  • 1
  • 8

2 Answers2

0

You can run the algorithm for the maximum number of iterations and then use CatBoost.predict() with ntree_limit parameter or CatBoost.staged_predict() to try different number of iterations.

Ha.
  • 3,454
  • 21
  • 24
0
  1. First i create a predictive model in R using XGB. Now i want to build a regression model using CatBoost to improve the results

    Superconductors dataset convert into training dataset & test dataset

dataset_catboost20<-read.csv("train.csv")

dataset_catboost20

rows<-nrow(dataset_catboost20)

f<-0.65

upper_bound_catboost20<- floor(f*rows)

permuted_dataset_catboost20<- dataset_catboost20[sample(rows),]

train_dataset_catboost20<-permuted_dataset_catboost20[1:upper_bound_catboost20,]

train_dataset_catboost20
  1. There are 28 independent variable & one dependent variable. Now i use the same formula as i use in XGB.Covert the formula into **sparse.model.matrix both in XGB & Catboost. In XGB formula was working but in Catboost it show error.**

Unsupported data type, expecting data.frame, got: dgCMatrix

Formula

train_dataset_catboost2020

y_traincatboost20=train_dataset_catboost20$critical_temp

catboost_trcontrol20<-trainControl(method="cv", number = 5,allowParallel = TRUE,verboseIter = FALSE,returnData = FALSE)
catboostGrid20 <- expand.grid(depth= c(2,6,8), learning_rate=0.1, iterations=100,
                              l2_leaf_reg=.05, rsm=.95, border_count=65)
catboost_model20 = train(
  train_dataset_catboost2020,y_traincatboost20,method = catboost.caret,
  logging_level="Silent",preProc=NULL,

  tuneGrid = catboostGrid20,trControl=catboost_trcontrol20 )
Maqsood
  • 21
  • 5