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

Function SavePoolToFile

catboost/cuda/ut_helpers/test_utils.cpp:60–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60void SavePoolToFile(TBinarizedPool& pool, const char* filename) {
61 TOFStream output(filename);
62 for (ui32 doc = 0; doc < pool.NumSamples; ++doc) {
63 TStringStream qid;
64 qid << pool.Qids[doc];
65 output << qid.Str() << "\t" << pool.Targets[doc] << "\tFakeUrl";
66 pool.Qids[doc] = CalcGroupIdFor(qid.Str());
67 for (ui32 f = 0; f < pool.NumCatFeatures; ++f) {
68 output << "\t" << pool.CatFeatures[f][doc];
69 }
70 for (ui32 f = 0; f < pool.NumFeatures; ++f) {
71 output << "\t" << (float)(pool.Features[f][doc]);
72 }
73 output << Endl;
74 }
75}
76
77void GenerateTestPool(TUnitTestPool& pool, ui32 numFeatures) {
78 TRandom rand(0);

Callers 8

TestDatasetHolderBuilderFunction · 0.85
TestTreeBuilderFunction · 0.85
RunTestsFunction · 0.85
RunTestsFunction · 0.85
RunTestsFunction · 0.85

Calls 2

CalcGroupIdForFunction · 0.85
StrMethod · 0.45

Tested by

no test coverage detected