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

Function dump

catboost/app/mode_metadata.cpp:105–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105int dump(int argc, const char* argv[]) {
106 TCommonMetaInfoParams params;
107 NCB::EInfoDumpFormat dumpFormat;
108 auto parser = NLastGetopt::TOpts();
109 parser.AddHelpOption();
110 params.BindParser(parser);
111 parser.AddLongOption("dump-format", "One of 'Plain', 'JSON'")
112 .DefaultValue("Plain")
113 .StoreResult(&dumpFormat);
114 parser.SetFreeArgsMax(0);
115 NLastGetopt::TOptsParseResult parserResult{&parser, argc, argv};
116 params.LoadModel();
117 if (NCB::EInfoDumpFormat::Plain == dumpFormat) {
118 for (const auto& keyValue : params.Model.ModelInfo) {
119 Cout << keyValue.first << "\t" << keyValue.second << Endl;
120 }
121 } else if (NCB::EInfoDumpFormat::JSON == dumpFormat) {
122 NJson::TJsonValue value;
123 for (const auto& keyValue : params.Model.ModelInfo) {
124 value[keyValue.first] = keyValue.second;
125 }
126 Cout << value.GetStringRobust() << Endl;
127 }
128 return 0;
129}
130
131int dump_feature_names(int argc, const char* argv[]) {
132 TCommonMetaInfoParams params;

Callers

nothing calls this directly

Calls 6

BindParserMethod · 0.80
SetFreeArgsMaxMethod · 0.80
LoadModelMethod · 0.80
TOptsClass · 0.50
DefaultValueMethod · 0.45
GetStringRobustMethod · 0.45

Tested by

no test coverage detected