fix typo in XGDMatrixSetFloatInfo example (#7097)

This commit is contained in:
ZabelTech
2021-07-10 15:40:25 +02:00
committed by GitHub
parent 77f6cf2d13
commit 1d91f71119

View File

@@ -220,7 +220,7 @@ Sample examples along with Code snippet to use C API functions
}
// Loading the labels
safe_xgboost(XGDMatrixSetFloatInfo(dmatrix, "labels", labels, ROWS));
safe_xgboost(XGDMatrixSetFloatInfo(dmatrix, "label", labels, ROWS));
// reading the labels and store the length of the result
bst_ulong result_len;
@@ -228,7 +228,7 @@ Sample examples along with Code snippet to use C API functions
// labels result
const float *result;
safe_xgboost(XGDMatrixGetFloatInfo(dmatrix, "labels", &result_len, &result));
safe_xgboost(XGDMatrixGetFloatInfo(dmatrix, "label", &result_len, &result));
for(unsigned int i = 0; i < result_len; i++) {
printf("label[%i] = %f\n", i, result[i]);