[dask] Return GPU Series when input is from cuDF. (#5710)

* Refactor predict function.
This commit is contained in:
Jiaming Yuan
2020-05-28 17:51:20 +08:00
committed by GitHub
parent 91c646392d
commit 35e2205256
5 changed files with 58 additions and 46 deletions

View File

@@ -1,6 +1,6 @@
# coding: utf-8
from xgboost.compat import SKLEARN_INSTALLED, PANDAS_INSTALLED
from xgboost.compat import CUDF_INSTALLED, DASK_INSTALLED
from xgboost.compat import DASK_INSTALLED
def no_sklearn():
@@ -46,6 +46,12 @@ def no_dask_cuda():
def no_cudf():
try:
import cudf # noqa
CUDF_INSTALLED = True
except ImportError:
CUDF_INSTALLED = False
return {'condition': not CUDF_INSTALLED,
'reason': 'CUDF is not installed'}