MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / LGBM_DatasetGetSubset_R

Function LGBM_DatasetGetSubset_R

src/lightgbm_R.cpp:110–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110LGBM_SE LGBM_DatasetGetSubset_R(LGBM_SE handle,
111 LGBM_SE used_row_indices,
112 LGBM_SE len_used_row_indices,
113 LGBM_SE parameters,
114 LGBM_SE out,
115 LGBM_SE call_state) {
116 R_API_BEGIN();
117 int len = R_AS_INT(len_used_row_indices);
118 std::vector<int> idxvec(len);
119 // convert from one-based to zero-based index
120#pragma omp parallel for schedule(static)
121 for (int i = 0; i < len; ++i) {
122 idxvec[i] = R_INT_PTR(used_row_indices)[i] - 1;
123 }
124 DatasetHandle res = nullptr;
125 CHECK_CALL(LGBM_DatasetGetSubset(R_GET_PTR(handle),
126 idxvec.data(), len, R_CHAR_PTR(parameters),
127 &res));
128 R_SET_PTR(out, res);
129 R_API_END();
130}
131
132LGBM_SE LGBM_DatasetSetFeatureNames_R(LGBM_SE handle,
133 LGBM_SE feature_names,

Callers

nothing calls this directly

Calls 4

dataMethod · 0.80
LGBM_DatasetGetSubsetFunction · 0.70
R_GET_PTRFunction · 0.50
R_SET_PTRFunction · 0.50

Tested by

no test coverage detected