2017-09-12 3 views
1

catboost을 정확히 이해하면 xgboost처럼 CV를 사용하여 nrounds을 조정해야합니다.`catboost`를 사용하여 nrounds를 선택하는 방법은 무엇입니까?

  • 이가 올바른지 :이 나는 official tutorial에서 [8] 최고의 iterations = 211

    내 질문을 초래할

    params_with_od <- list(iterations = 500, 
             loss_function = 'Logloss', 
             train_dir = 'train_dir', 
             od_type = 'Iter', 
             od_wait = 30) 
    model_with_od <- catboost.train(train_pool, test_pool, params_with_od) 
    

    있습니다에 다음 코드를 참조 명령 test_pool을 사용하여 교차 유효성 검사 대신 최상의 iterations을 선택 하시겠습니까?

  • 예인 경우 catboost에서 CV에서 가장 좋은 iterations을 선택하라는 명령을 제공합니까? 아니면 수동으로해야합니까?

답변

0

Catboost는 교차 유효성 검사를 수행하여 최적의 반복 횟수를 결정합니다. train_pool과 test_pool은 모두 대상 변수를 포함하는 데이터 집합입니다. 당신이 catboost.train을 (train_pool, test_pool, params_with_od) train_pool 훈련에 사용되며 test_pool가 교차 검증을 통해 반복의 최적의 수를 결정하는 데 사용되는 실행하면 이전 튜토리얼에서 그들은

train_path = '../R-package/inst/extdata/adult_train.1000' 
test_path = '../R-package/inst/extdata/adult_test.1000' 

column_description_vector = rep('numeric', 15) 
cat_features <- c(3, 5, 7, 8, 9, 10, 11, 15) 
for (i in cat_features) 
    column_description_vector[i] <- 'factor' 

train <- read.table(train_path, head=F, sep="\t", colClasses=column_description_vector) 
test <- read.table(test_path, head=F, sep="\t", colClasses=column_description_vector) 
target <- c(1) 
train_pool <- catboost.from_data_frame(data=train[,-target], target=train[,target]) 
test_pool <- catboost.from_data_frame(data=test[,-target], target=test[,target]) 

물품.

이제 당신은 나중에 그들이 다시 예측을 할 test_pool 및 피팅 모델을 사용 튜토리얼에 있기 때문에, 혼동 될 맞다 (model_best이 model_with_od 유사하지만 다른 overfitting 검출기 IncToDec 사용) :

prediction_best <- catboost.predict(model_best, test_pool, type = 'Probability') 

이것은 좋지 않을 수 있습니다. 이제 그들은 IncToDec overfitting detector로 도망 갈 수 있습니다 - 저는 수학에 익숙하지 않습니다 - Iter type overfitting detector의 경우 train, validation 및 test 데이터 세트가 따로 있어야합니다. 세이프 사이드에서는 IncToDec과 퍼팅 검출기에 대해 동일한 작업을 수행합니다. 그러나 기능을 보여주는 튜토리얼 일 뿐이므로 이미 사용 된 데이터에 대해 너무 성급한 것은 아닙니다. 여기

overfitting 검출기에 좀 더 세부 사항에 대한 링크 : https://tech.yandex.com/catboost/doc/dg/concepts/overfitting-detector-docpage/

+0

그래서 실제로 1 배 교차 검증입니까? – Metariat

+0

맞습니다. – ftiaronsem

1

사용 캐럿 교차 검증. tutorial의 [12]에주의하십시오.

+0

외부 링크 만 참조하는 대신 좀 더 자세히 설명해주십시오. –