fix the negative dimension error in python predict

This commit is contained in:
Guolin Ke 2018-08-23 09:38:09 +08:00 коммит произвёл GitHub
Родитель 941068eea8
Коммит 542c34ddfc
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -224,7 +224,7 @@ public:
OMP_LOOP_EX_END();
}
OMP_THROW_EX();
*out_len = nrow * num_pred_in_one_row;
*out_len = num_pred_in_one_row * nrow;
}
void Predict(int num_iteration, int predict_type, const char* data_filename,
@ -1088,8 +1088,8 @@ int LGBM_BoosterCalcNumPredict(BoosterHandle handle,
int64_t* out_len) {
API_BEGIN();
Booster* ref_booster = reinterpret_cast<Booster*>(handle);
*out_len = static_cast<int64_t>(num_row * ref_booster->GetBoosting()->NumPredictOneRow(
num_iteration, predict_type == C_API_PREDICT_LEAF_INDEX, predict_type == C_API_PREDICT_CONTRIB));
*out_len = static_cast<int64_t>(num_row) * ref_booster->GetBoosting()->NumPredictOneRow(
num_iteration, predict_type == C_API_PREDICT_LEAF_INDEX, predict_type == C_API_PREDICT_CONTRIB);
API_END();
}