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

Function Y_UNIT_TEST

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

Source from the content-addressed store, hash-verified

66
67Y_UNIT_TEST_SUITE(TRawObjectsData) {
68 Y_UNIT_TEST(CommonObjectsData) {
69 TVector<TObjectsGrouping> srcObjectsGroupings;
70 TVector<TCommonObjectsData> srcDatas;
71
72 {
73 srcObjectsGroupings.push_back(TObjectsGrouping(ui32(4)));
74
75 TCommonObjectsData commonData;
76 commonData.FeaturesLayout = MakeIntrusive<TFeaturesLayout>();
77 commonData.SubsetIndexing = MakeAtomicShared<TArraySubsetIndexing<ui32>>(
78 TFullSubset<ui32>(4)
79 );
80
81 srcDatas.push_back(commonData);
82 }
83
84 {
85 srcObjectsGroupings.push_back(
86 TObjectsGrouping(TVector<TGroupBounds>{{0, 2}, {2, 3}, {3, 4}, {4, 6}})
87 );
88
89 TCommonObjectsData commonData;
90 commonData.FeaturesLayout = MakeIntrusive<TFeaturesLayout>();
91
92 TVector<TIndexRange<ui32>> indexRanges{{7, 10}, {2, 3}, {4, 6}};
93 TSavedIndexRanges<ui32> savedIndexRanges(std::move(indexRanges));
94
95 commonData.SubsetIndexing = MakeAtomicShared<TArraySubsetIndexing<ui32>>(
96 TRangesSubset<ui32>(savedIndexRanges)
97 );
98 commonData.GroupIds.GetMaybeNumData() = {0, 0, 2, 3, 4, 4};
99
100 srcDatas.push_back(commonData);
101 }
102
103 {
104 srcObjectsGroupings.push_back(
105 TObjectsGrouping(TVector<TGroupBounds>{{0, 2}, {2, 3}, {3, 4}})
106 );
107
108 TCommonObjectsData commonData;
109 commonData.FeaturesLayout = MakeIntrusive<TFeaturesLayout>();
110 commonData.SubsetIndexing = MakeAtomicShared<TArraySubsetIndexing<ui32>>(
111 TIndexedSubset<ui32>{0, 4, 3, 1}
112 );
113 commonData.GroupIds.GetMaybeNumData() = {0, 0, 3, 1};
114 commonData.SubgroupIds.GetMaybeNumData() = {0, 2, 3, 1};
115
116 srcDatas.push_back(commonData);
117 }
118
119 {
120 srcObjectsGroupings.push_back(TObjectsGrouping(ui32(4)));
121
122 TCommonObjectsData commonData;
123 commonData.FeaturesLayout = MakeIntrusive<TFeaturesLayout>();
124 commonData.SubsetIndexing = MakeAtomicShared<TArraySubsetIndexing<ui32>>(
125 TFullSubset<ui32>(4)

Callers

nothing calls this directly

Calls 15

TObjectsGroupingClass · 0.85
xrangeFunction · 0.85
NothingFunction · 0.85
GetFloatFeatures1Function · 0.85
GetCatFeaturesWithHash1Function · 0.85
TestSubsetFeaturesFunction · 0.85
RunAdditionalThreadsMethod · 0.80
GetTimestampMethod · 0.80
EqualFunction · 0.70
moveFunction · 0.50

Tested by

no test coverage detected