| 217 | |
| 218 | |
| 219 | TFeaturesSelectionSummary SelectFeatures( |
| 220 | TCatBoostOptions catBoostOptions, |
| 221 | TOutputFilesOptions outputFileOptions, |
| 222 | const TPoolLoadParams* poolLoadParams, |
| 223 | const TFeaturesSelectOptions& featuresSelectOptions, |
| 224 | const TMaybe<TCustomMetricDescriptor>& evalMetricDescriptor, |
| 225 | const TDataProviders& pools, |
| 226 | TFullModel* dstModel, |
| 227 | const TVector<TEvalResult*>& evalResultPtrs, |
| 228 | TMetricsAndTimeLeftHistory* metricsAndTimeHistory, |
| 229 | NPar::ILocalExecutor* executor |
| 230 | ) { |
| 231 | TSetLogging inThisScope(catBoostOptions.LoggingLevel); |
| 232 | |
| 233 | CheckOptions( |
| 234 | catBoostOptions, |
| 235 | featuresSelectOptions, |
| 236 | pools |
| 237 | ); |
| 238 | |
| 239 | TLabelConverter labelConverter; |
| 240 | TRestorableFastRng64 rand(catBoostOptions.RandomSeed); |
| 241 | |
| 242 | TDataProviderPtr srcPool = pools.Test.empty() ? pools.Learn : pools.Test[0]; |
| 243 | TMaybe<TPathWithScheme> srcPoolPath = poolLoadParams |
| 244 | ? MakeMaybe(pools.Test.empty() ? poolLoadParams->LearnSetPath : poolLoadParams->TestSetPaths[0]) |
| 245 | : Nothing(); |
| 246 | const bool haveFeaturesInMemory = HaveFeaturesInMemory(catBoostOptions, srcPoolPath); |
| 247 | TDataProviderPtr fstrPool = haveFeaturesInMemory |
| 248 | ? GetSubsetForFstrCalc(srcPool, executor) |
| 249 | : LoadSubsetForFstrCalc(srcPool, catBoostOptions, poolLoadParams, executor); |
| 250 | CATBOOST_DEBUG_LOG << "Fstr pool size: " << fstrPool->GetObjectCount() << Endl; |
| 251 | |
| 252 | auto trainingData = QuantizePools( |
| 253 | poolLoadParams, |
| 254 | outputFileOptions, |
| 255 | pools, |
| 256 | &catBoostOptions, |
| 257 | &labelConverter, |
| 258 | &rand, |
| 259 | executor |
| 260 | ); |
| 261 | |
| 262 | const bool haveLearnFeaturesInMemory = HaveFeaturesInMemory( |
| 263 | catBoostOptions, |
| 264 | poolLoadParams ? MakeMaybe(poolLoadParams->LearnSetPath) : Nothing() |
| 265 | ); |
| 266 | |
| 267 | THolder<TMasterContext> masterContext; |
| 268 | |
| 269 | if (catBoostOptions.SystemOptions->IsMaster()) { |
| 270 | masterContext.Reset(new TMasterContext(catBoostOptions.SystemOptions)); |
| 271 | if (!haveLearnFeaturesInMemory) { |
| 272 | TVector<TObjectsGrouping> testObjectsGroupings; |
| 273 | for (const auto& testDataset : trainingData.Test) { |
| 274 | testObjectsGroupings.push_back(*(testDataset->ObjectsGrouping)); |
| 275 | } |
| 276 | SetTrainDataFromQuantizedPools( |
no test coverage detected