Skip to content

Commit

Permalink
Use dtype constant for predict [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Dec 16, 2024
1 parent 4af0fe2 commit a15c129
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/lightgbm/inner_predictor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def inner_predict_array2d(input, start_iteration, num_iteration, predict_type)

out_num_preds = ::FFI::MemoryPointer.new(:int64)
out_result = ::FFI::MemoryPointer.new(:double, n_preds)
safe_call FFI.LGBM_BoosterPredictForMat(@handle, data, 1, input.count, input.first.count, 1, predict_type, start_iteration, num_iteration, @pred_parameter, out_num_preds, out_result)
safe_call FFI.LGBM_BoosterPredictForMat(@handle, data, FFI::C_API_DTYPE_FLOAT64, input.count, input.first.count, 1, predict_type, start_iteration, num_iteration, @pred_parameter, out_num_preds, out_result)
if n_preds != out_num_preds.read_int64
raise Error, "Wrong length for predict results"
end
Expand Down

0 comments on commit a15c129

Please sign in to comment.