[jvm-packages] Deprecate constructors with implicit missing value. (#7225)

This commit is contained in:
Jiaming Yuan
2021-09-17 04:35:04 +08:00
committed by GitHub
parent 0ed979b096
commit 9f63d6fead
4 changed files with 10 additions and 5 deletions

View File

@@ -124,7 +124,11 @@ public class DMatrix {
* @param nrow number of rows
* @param ncol number of columns
* @throws XGBoostError native error
*
* @deprecated Please specify the missing value explicitly using
* {@link DMatrix(float[], int, int, float)}
*/
@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));

View File

@@ -79,6 +79,7 @@ class DMatrix private[scala](private[scala] val jDMatrix: JDMatrix) {
* @param nrow number of rows
* @param ncol number of columns
*/
@deprecated("Please specify the missing value explicitly", "XGBoost 1.5")
@throws(classOf[XGBoostError])
def this(data: Array[Float], nrow: Int, ncol: Int) {
this(new JDMatrix(data, nrow, ncol))