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

Method TModeParams

catboost/app/mode_normalize_model.cpp:42–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40 bool PrintScaleAndBias = false;
41
42 TModeParams(int argc, const char* argv[]) {
43 auto parser = NLastGetopt::TOpts();
44 parser.AddHelpOption();
45 parser.SetFreeArgsNum(0);
46 BindModelFileParams(&parser, &ModelFileName, &ModelType);
47 DatasetReadingBaseParams.BindParserOpts(&parser);
48 parser.AddLongOption("set-scale").RequiredArgument("SCALE")
49 .Handler1T<double>([this](auto scale){ Scale = scale; })
50 .Help("Scale")
51 ;
52 parser.AddLongOption("set-bias").RequiredArgument("BIAS")
53 .Handler1T<TStringBuf>([this](auto bias) {
54 Bias = TVector<double>(0);
55 for (const auto& biasValue : StringSplitter(bias).Split(':')) {
56 Bias->push_back(FromString<double>(biasValue.Token()));
57 }
58 })
59 .Help("Bias")
60 ;
61 parser.AddLongOption("print-scale-and-bias").NoArgument()
62 .StoreTrue(&PrintScaleAndBias)
63 .Help("Print input and resulting scale and bias")
64 ;
65 parser.AddLongOption("logging-level").RequiredArgument("LEVEL")
66 .Handler1T<TStringBuf>([this](auto level){ LoggingLevel = FromString<ELoggingLevel>(level); })
67 .Help("Logging level, one of " + GetEnumAllNames<ELoggingLevel>())
68 .DefaultValue(ELoggingLevel::Info)
69 ;
70 parser.AddLongOption('T', "thread-count").RequiredArgument("N")
71 .StoreResult(&ThreadCount)
72 .Help("Worker thread count")
73 .DefaultValue(NSystemInfo::CachedNumberOfCpus())
74 ;
75 parser.AddLongOption('i', "input-path").RequiredArgument("PATH...")
76 .Handler1T<TStringBuf>([this](auto path){ PoolPaths.push_back(TPathWithScheme{path, "dsv"}); })
77 .Help("Pool path (repeat the option for multiple pools)")
78 ;
79 parser.AddLongOption("output-model").RequiredArgument("PATH")
80 .StoreResult(&OutputModelFileName)
81 .Help("Output model path")
82 ;
83 parser.AddLongOption("output-model-format").RequiredArgument("FORMAT")
84 .Handler1T<TStringBuf>([this](auto format){ OutputModelType = FromString<EModelType>(format); })
85 .Help("Output model format, one of " + GetEnumAllNames<EModelType>())
86 ;
87 NLastGetopt::TOptsParseResult parseResult{&parser, argc, argv};
88 }
89 };
90
91 class TOpenSourceModeNormalizeModelImplementation : public IModeNormalizeModelImplementation {

Callers

nothing calls this directly

Calls 9

StringSplitterFunction · 0.85
SetFreeArgsNumMethod · 0.80
TOptsClass · 0.50
BindParserOptsMethod · 0.45
HelpMethod · 0.45
SplitMethod · 0.45
push_backMethod · 0.45
TokenMethod · 0.45
DefaultValueMethod · 0.45

Tested by

no test coverage detected