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

Method Load

catboost/private/libs/options/overfitting_detector_options.cpp:24–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24void NCatboostOptions::TOverfittingDetectorOptions::Load(const NJson::TJsonValue& options) {
25 if (!options.Has("type")) {
26 if (options.Has("stop_pvalue")) {
27 OverfittingDetectorType.Set(EOverfittingDetectorType::IncToDec);
28 } else if (options.Has("wait_iterations")) {
29 OverfittingDetectorType.Set(EOverfittingDetectorType::Iter);
30 } else {
31 OverfittingDetectorType.Set(EOverfittingDetectorType::None);
32 }
33 }
34 CheckedLoad(options, &AutoStopPValue, &OverfittingDetectorType, &IterationsWait);
35 CB_ENSURE(
36 (OverfittingDetectorType.Get() != EOverfittingDetectorType::Iter)
37 || !options.Has("stop_pvalue")
38 || (options["stop_pvalue"].GetDouble() == 0.0), // this check is needed because the default value is serialized
39 "Auto-stop PValue is not a valid parameter for Iter overfitting detector."
40 );
41 Validate();
42}
43
44void NCatboostOptions::TOverfittingDetectorOptions::Save(NJson::TJsonValue* options) const {
45 SaveFields(options, AutoStopPValue, OverfittingDetectorType, IterationsWait);

Callers

nothing calls this directly

Calls 6

CheckedLoadFunction · 0.85
ValidateFunction · 0.50
HasMethod · 0.45
SetMethod · 0.45
GetMethod · 0.45
GetDoubleMethod · 0.45

Tested by

no test coverage detected