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

Function GenerateSrcHashedCatData

catboost/libs/data/ut/objects_ut.cpp:738–755  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

736Y_UNIT_TEST_SUITE(TQuantizedObjectsData) {
737
738 TVector<ui32> GenerateSrcHashedCatData(ui32 uniqValues) {
739 TFastRng<ui32> rng(0);
740
741 TVector<ui32> result;
742
743 for (ui32 value : xrange(uniqValues)) {
744 // repeat each value from 1 to 10 times, simple rand() is ok for this purpose
745 ui32 repetitionCount = rng.Uniform(1, 11) ;//ui32(1 + (std::rand() % 10));
746 for (auto i : xrange(repetitionCount)) {
747 Y_UNUSED(i);
748 result.push_back(value);
749 }
750 }
751
752 Shuffle(result.begin(), result.end(), rng);
753
754 return result;
755 }
756
757
758 void TestSubsetFeatures(

Callers 1

TestSubsetFeaturesFunction · 0.85

Calls 7

xrangeFunction · 0.85
Y_UNUSEDFunction · 0.85
ShuffleFunction · 0.50
UniformMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by 1

TestSubsetFeaturesFunction · 0.68