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

Function mode_select_features

catboost/app/mode_select_features.cpp:126–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124
125
126int mode_select_features(int argc, const char* argv[]) {
127 ConfigureMalloc();
128
129 #if defined(USE_MPI)
130 char** args = const_cast<char**>(argv);
131 auto& mpiManager = NCudaLib::GetMpiManager();
132 mpiManager.Start(&argc, &args);
133 CATBOOST_DEBUG_LOG << (mpiManager.IsMaster() ? "MASTER" : "SLAVE") << Endl;
134 if (!mpiManager.IsMaster()) {
135 CATBOOST_DEBUG_LOG << "Running MPI slave" << Endl;
136 RunSlave();
137 return 0;
138 }
139 #endif
140
141 TCatBoostOptions catBoostOptions(ETaskType::CPU /* no matter */);
142 TOutputFilesOptions outputOptions;
143 TPoolLoadParams poolLoadParams;
144 TFeaturesSelectOptions featuresSelectOptions;
145 LoadOptions(
146 argc,
147 argv,
148 &catBoostOptions,
149 &outputOptions,
150 &poolLoadParams,
151 &featuresSelectOptions
152 );
153
154 TSetLogging inThisScope(catBoostOptions.LoggingLevel);
155
156 auto trainerEnv = NCB::CreateTrainerEnv(catBoostOptions);
157
158 NPar::TLocalExecutor executor;
159 executor.RunAdditionalThreads(catBoostOptions.SystemOptions->NumThreads - 1);
160
161 CATBOOST_INFO_LOG << "Loading pools..." << Endl;
162 auto pools = LoadPools(
163 catBoostOptions,
164 poolLoadParams,
165 &catBoostOptions.DataProcessingOptions->HasTimeFlag,
166 &executor
167 );
168
169 TVector<TEvalResult> evalResults(pools.Test.size());
170
171 const TFeaturesSelectionSummary summary = SelectFeatures(
172 catBoostOptions,
173 outputOptions,
174 &poolLoadParams,
175 featuresSelectOptions,
176 /*evalMetricDescriptor*/ Nothing(),
177 pools,
178 /*dstModel*/ nullptr,
179 /*evalResults*/ GetMutablePointers(evalResults),
180 /*metricsAndTimeHistory*/ nullptr,
181 &executor
182 );
183 SaveSummaryToFile(summary, featuresSelectOptions.ResultPath);

Callers

nothing calls this directly

Calls 14

ConfigureMallocFunction · 0.85
CreateTrainerEnvFunction · 0.85
SelectFeaturesFunction · 0.85
NothingFunction · 0.85
GetMutablePointersFunction · 0.85
SaveSummaryToFileFunction · 0.85
RunAdditionalThreadsMethod · 0.80
LoadOptionsFunction · 0.70
LoadPoolsFunction · 0.70
RunSlaveFunction · 0.50
StartMethod · 0.45
IsMasterMethod · 0.45

Tested by

no test coverage detected