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

Function LoadTrainingData

catboost/cuda/ut_helpers/test_utils.cpp:138–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138void LoadTrainingData(NCB::TPathWithScheme poolPath,
139 NCB::TPathWithScheme cdFilePath,
140 const NCatboostOptions::TBinarizationOptions& floatFeaturesBinarization,
141 const NCatboostOptions::TCatFeatureParams& catFeatureParams,
142 const NCB::TFeatureEstimators& estimators,
143 NCB::TTrainingDataProviderPtr* trainingData,
144 THolder<NCatboostCuda::TBinarizedFeaturesManager>* featuresManager) {
145 NCB::TDataProviderPtr dataProvider;
146 {
147 NCatboostOptions::TColumnarPoolFormatParams columnarPoolFormatParams;
148 columnarPoolFormatParams.CdFilePath = cdFilePath;
149
150 dataProvider = NCB::ReadDataset(ETaskType::GPU,
151 poolPath,
152 NCB::TPathWithScheme(),
153 NCB::TPathWithScheme(),
154 NCB::TPathWithScheme(),
155 NCB::TPathWithScheme(),
156 NCB::TPathWithScheme(),
157 NCB::TPathWithScheme(),
158 NCB::TPathWithScheme(),
159 columnarPoolFormatParams,
160 {},
161 NCB::EObjectsOrder::Ordered,
162 16,
163 true,
164 false,
165 false,
166 /*classLabels*/ Nothing());
167 }
168
169 NCatboostOptions::TCatBoostOptions catBoostOptions(ETaskType::GPU);
170 catBoostOptions.DataProcessingOptions.Get().FloatFeaturesBinarization = floatFeaturesBinarization;
171 catBoostOptions.CatFeatureParams = catFeatureParams;
172
173 TLabelConverter labelConverter;
174
175 NPar::TLocalExecutor localExecutor;
176 localExecutor.RunAdditionalThreads(15);
177
178 TRestorableFastRng64 rand(0);
179
180 TMaybe<float> targetBorder = catBoostOptions.DataProcessingOptions->TargetBorder;
181
182 *trainingData = NCB::GetTrainingData(std::move(dataProvider),
183 /*dataCanBeEmpty*/ false,
184 /*isLearn*/ true,
185 "learn",
186 Nothing(),
187 /*unloadCatFeaturePerfectHashFromRam*/ true,
188 /*ensureConsecutiveFeaturesDataForCpu*/ false, // irrelevant for GPU
189 /*tmpDir*/ GetSystemTempDir(),
190 nullptr,
191 &catBoostOptions,
192 &labelConverter,
193 &targetBorder,
194 &localExecutor,
195 &rand);

Callers 9

TestDatasetHolderBuilderFunction · 0.85
TestTreeBuilderFunction · 0.85
TestPairwiseHistFunction · 0.85
TestPointwiseHistFunction · 0.85
TestSplitPropsHelperFunction · 0.85

Calls 12

ReadDatasetFunction · 0.85
NothingFunction · 0.85
GetTrainingDataFunction · 0.85
GetSystemTempDirFunction · 0.85
TBordersBuilderClass · 0.85
RunAdditionalThreadsMethod · 0.80
TPathWithSchemeClass · 0.50
moveFunction · 0.50
GetMethod · 0.45
GetObjectCountMethod · 0.45

Tested by

no test coverage detected