diff --git a/python-package/xgboost/core.py b/python-package/xgboost/core.py index 60ba97a40..cde339bb8 100644 --- a/python-package/xgboost/core.py +++ b/python-package/xgboost/core.py @@ -14,6 +14,7 @@ import ctypes import os import re import sys +import warnings import numpy as np import scipy.sparse @@ -381,6 +382,10 @@ class DMatrix(object): label = _maybe_dt_array(label) weight = _maybe_dt_array(weight) + if isinstance(data, list): + warnings.warn('Initializing DMatrix from List is deprecated.', + DeprecationWarning) + if isinstance(data, STRING_TYPES): self.handle = ctypes.c_void_p() _check_call(_LIB.XGDMatrixCreateFromFile(c_str(data),