MCPcopy Create free account
hub / github.com/catboost/catboost / UpdateLearningRate

Function UpdateLearningRate

catboost/libs/train_lib/options_helper.cpp:269–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267};
268
269static void UpdateLearningRate(ui32 learnObjectCount, bool useBestModel, NCatboostOptions::TCatBoostOptions* catBoostOptions) {
270 const bool boostFromAverage = catBoostOptions->BoostingOptions->BoostFromAverage.Get();
271 auto& learningRate = catBoostOptions->BoostingOptions->LearningRate;
272 const int iterationCount = catBoostOptions->BoostingOptions->IterationCount;
273 const auto lossFunction = catBoostOptions->LossFunctionDescription->GetLossFunction();
274 const auto taskType = catBoostOptions->GetTaskType();
275
276 if (
277 learningRate.NotSet() &&
278 catBoostOptions->ObliviousTreeOptions->LeavesEstimationMethod.NotSet() &&
279 catBoostOptions->ObliviousTreeOptions->LeavesEstimationIterations.NotSet() &&
280 catBoostOptions->ObliviousTreeOptions->L2Reg.NotSet()
281 ) {
282 TAutoLRParamsGuesser lrGuesser;
283 if (lrGuesser.NeedToUpdate(taskType, lossFunction, useBestModel, boostFromAverage)) {
284 learningRate = lrGuesser.GetLearningRate(taskType, lossFunction, useBestModel, boostFromAverage, iterationCount, learnObjectCount);
285 CATBOOST_NOTICE_LOG << "Learning rate set to " << learningRate << Endl;
286 }
287 }
288}
289
290static void UpdateLeavesEstimationIterations(
291 const NCB::TDataMetaInfo& trainDataMetaInfo,

Callers 1

SetDataDependentDefaultsFunction · 0.85

Calls 6

GetTaskTypeMethod · 0.80
NotSetMethod · 0.80
NeedToUpdateMethod · 0.80
GetLearningRateMethod · 0.80
GetMethod · 0.45
GetLossFunctionMethod · 0.45

Tested by

no test coverage detected