| 41 | using NCB::TUnalignedArrayBuf; |
| 42 | |
| 43 | NCB::TCBQuantizedDataLoader::TCBQuantizedDataLoader(TDatasetLoaderPullArgs&& args) |
| 44 | : ObjectCount(0) // inited later |
| 45 | , QuantizedPool( |
| 46 | std::forward<TQuantizedPool>( |
| 47 | LoadQuantizedPool(args.PoolPath, GetLoadParameters(args.CommonArgs.DatasetSubset)) |
| 48 | ) |
| 49 | ) |
| 50 | , PairsPath(args.CommonArgs.PairsFilePath) |
| 51 | , GraphPath(args.CommonArgs.GraphFilePath) |
| 52 | , GroupWeightsPath(args.CommonArgs.GroupWeightsFilePath) |
| 53 | , BaselinePath(args.CommonArgs.BaselineFilePath) |
| 54 | , TimestampsPath(args.CommonArgs.TimestampsFilePath) |
| 55 | , PoolMetaInfoPath(args.CommonArgs.PoolMetaInfoPath) |
| 56 | , ObjectsOrder(args.CommonArgs.ObjectsOrder) |
| 57 | , DatasetSubset(args.CommonArgs.DatasetSubset) |
| 58 | { |
| 59 | CB_ENSURE(QuantizedPool.DocumentCount > 0, "Pool is empty"); |
| 60 | CB_ENSURE( |
| 61 | QuantizedPool.DocumentCount <= (size_t)Max<ui32>(), |
| 62 | "CatBoost does not support datasets with more than " << Max<ui32>() << " objects" |
| 63 | ); |
| 64 | // validity of cast checked above |
| 65 | ObjectCount = Min<ui32>(QuantizedPool.DocumentCount, DatasetSubset.Range.End) - DatasetSubset.Range.Begin; |
| 66 | |
| 67 | CB_ENSURE( |
| 68 | !PairsPath.Inited() || CheckExists(PairsPath), |
| 69 | "TCBQuantizedDataLoader:PairsFilePath does not exist"); |
| 70 | CB_ENSURE( |
| 71 | !GraphPath.Inited() || CheckExists(GraphPath), |
| 72 | "TCBQuantizedDataLoader:GraphFilePath does not supported"); |
| 73 | CB_ENSURE( |
| 74 | !GroupWeightsPath.Inited() || CheckExists(GroupWeightsPath), |
| 75 | "TCBQuantizedDataLoader:GroupWeightsFilePath does not exist"); |
| 76 | CB_ENSURE( |
| 77 | !TimestampsPath.Inited() || CheckExists(TimestampsPath), |
| 78 | "TCBQuantizedDataLoader:TimestampsPath does not exist"); |
| 79 | CB_ENSURE( |
| 80 | !FeatureNamesPath.Inited() || CheckExists(FeatureNamesPath), |
| 81 | "TCBQuantizedDataLoader:FeatureNamesPath does not exist"); |
| 82 | CB_ENSURE( |
| 83 | !PoolMetaInfoPath.Inited() || CheckExists(PoolMetaInfoPath), |
| 84 | "TCBQuantizedDataLoader:PoolMetaInfoPath does not exist"); |
| 85 | |
| 86 | THolder<NCB::IBaselineReader> baselineReader; |
| 87 | if (BaselinePath.Inited()) { |
| 88 | CB_ENSURE( |
| 89 | CheckExists(BaselinePath), |
| 90 | "TCBQuantizedDataLoader:BaselineFilePath does not exist"); |
| 91 | |
| 92 | baselineReader = GetProcessor<NCB::IBaselineReader, NCB::TBaselineReaderArgs>( |
| 93 | BaselinePath, |
| 94 | NCB::TBaselineReaderArgs{ |
| 95 | BaselinePath, |
| 96 | ClassLabelsToStrings(args.CommonArgs.ClassLabels), |
| 97 | DatasetSubset.Range |
| 98 | } |
| 99 | ); |
| 100 | } |
nothing calls this directly
no test coverage detected