Skip to content

Commit

Permalink
[JVM] Change default missing value to NaN for better alignment (#11225)
Browse files Browse the repository at this point in the history
Co-authored-by: a.cherkaoui <[email protected]>
  • Loading branch information
ayoub317 and a.cherkaoui authored Feb 12, 2025
1 parent ebca332 commit 8fc48d0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public DMatrix(long[] headers, int[] indices, float[] data, DMatrix.SparseType s
@Deprecated
public DMatrix(float[] data, int nrow, int ncol) throws XGBoostError {
long[] out = new long[1];
XGBoostJNI.checkCall(XGBoostJNI.XGDMatrixCreateFromMat(data, nrow, ncol, 0.0f, out));
XGBoostJNI.checkCall(XGBoostJNI.XGDMatrixCreateFromMat(data, nrow, ncol, Float.NaN, out));
handle = out[0];
}

Expand All @@ -147,7 +147,7 @@ public DMatrix(float[] data, int nrow, int ncol) throws XGBoostError {
* @throws XGBoostError native error
*/
public DMatrix(BigDenseMatrix matrix) throws XGBoostError {
this(matrix, 0.0f);
this(matrix, Float.NaN);
}

/**
Expand Down

0 comments on commit 8fc48d0

Please sign in to comment.