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

Function get_keys

catboost/app/mode_metadata.cpp:72–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72int get_keys(int argc, const char* argv[]) {
73 TCommonMetaInfoParams params;
74 NCB::EInfoDumpFormat dumpFormat;
75 TVector<TString> keys;
76 auto parser = NLastGetopt::TOpts();
77 parser.AddHelpOption();
78 params.BindParser(parser);
79 parser.AddLongOption("key", "keys to dump")
80 .AppendTo(&keys);
81 parser.AddLongOption("dump-format", "One of 'Plain', 'JSON'")
82 .DefaultValue("Plain")
83 .StoreResult(&dumpFormat);
84 parser.SetFreeArgDefaultTitle("KEY", "you can use freeargs to select keys");
85 NLastGetopt::TOptsParseResult parserResult{&parser, argc, argv};
86 for (const auto& key : parserResult.GetFreeArgs()) {
87 keys.push_back(key);
88 }
89 CB_ENSURE(!keys.empty(), "Select at least one property to dump");
90 params.LoadModel();
91 if (NCB::EInfoDumpFormat::Plain == dumpFormat) {
92 for (const auto& key : keys) {
93 Cout << key << "\t" << params.Model.ModelInfo[key] << Endl;
94 }
95 } else {
96 NJson::TJsonValue value;
97 for (const auto& key : keys) {
98 value[key] = params.Model.ModelInfo[key];
99 }
100 Cout << value.GetStringRobust() << Endl;
101 }
102 return 0;
103}
104
105int dump(int argc, const char* argv[]) {
106 TCommonMetaInfoParams params;

Callers

nothing calls this directly

Calls 9

BindParserMethod · 0.80
LoadModelMethod · 0.80
TOptsClass · 0.50
DefaultValueMethod · 0.45
GetFreeArgsMethod · 0.45
push_backMethod · 0.45
emptyMethod · 0.45
GetStringRobustMethod · 0.45

Tested by

no test coverage detected