Skip to content

Commit 8fc48d0

Browse files
ayoub317a.cherkaoui
andauthored
[JVM] Change default missing value to NaN for better alignment (dmlc#11225)
Co-authored-by: a.cherkaoui <[email protected]>
1 parent ebca332 commit 8fc48d0

File tree

1 file changed

+2
-2
lines changed
  • jvm-packages/xgboost4j/src/main/java/ml/dmlc/xgboost4j/java

1 file changed

+2
-2
lines changed

jvm-packages/xgboost4j/src/main/java/ml/dmlc/xgboost4j/java/DMatrix.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public DMatrix(long[] headers, int[] indices, float[] data, DMatrix.SparseType s
136136
@Deprecated
137137
public DMatrix(float[] data, int nrow, int ncol) throws XGBoostError {
138138
long[] out = new long[1];
139-
XGBoostJNI.checkCall(XGBoostJNI.XGDMatrixCreateFromMat(data, nrow, ncol, 0.0f, out));
139+
XGBoostJNI.checkCall(XGBoostJNI.XGDMatrixCreateFromMat(data, nrow, ncol, Float.NaN, out));
140140
handle = out[0];
141141
}
142142

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

153153
/**

0 commit comments

Comments
 (0)