| 136 | } |
| 137 | |
| 138 | void 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); |
no test coverage detected