Unverified Commit c5cfe3e3 authored by Nikita Titov's avatar Nikita Titov Committed by GitHub
Browse files

[python] update DataTable handling (#2020)

parent 414bb609
...@@ -36,7 +36,7 @@ The LightGBM Python module can load data from: ...@@ -36,7 +36,7 @@ The LightGBM Python module can load data from:
- libsvm/tsv/csv/txt format file - libsvm/tsv/csv/txt format file
- NumPy 2D array(s), pandas DataFrame, H2O DataTable, SciPy sparse matrix - NumPy 2D array(s), pandas DataFrame, H2O DataTable's Frame, SciPy sparse matrix
- LightGBM binary file - LightGBM binary file
......
...@@ -409,7 +409,7 @@ class _InnerPredictor(object): ...@@ -409,7 +409,7 @@ class _InnerPredictor(object):
Parameters Parameters
---------- ----------
data : string, numpy array, pandas DataFrame, H2O DataTable or scipy.sparse data : string, numpy array, pandas DataFrame, H2O DataTable's Frame or scipy.sparse
Data source for prediction. Data source for prediction.
When data type is string, it represents the path of txt file. When data type is string, it represents the path of txt file.
num_iteration : int, optional (default=-1) num_iteration : int, optional (default=-1)
...@@ -652,7 +652,7 @@ class Dataset(object): ...@@ -652,7 +652,7 @@ class Dataset(object):
Parameters Parameters
---------- ----------
data : string, numpy array, pandas DataFrame, H2O DataTable, scipy.sparse or list of numpy arrays data : string, numpy array, pandas DataFrame, H2O DataTable's Frame, scipy.sparse or list of numpy arrays
Data source of Dataset. Data source of Dataset.
If string, it represents the path to txt file. If string, it represents the path to txt file.
label : list, numpy 1-D array, pandas Series / one-column DataFrame or None, optional (default=None) label : list, numpy 1-D array, pandas Series / one-column DataFrame or None, optional (default=None)
...@@ -1009,7 +1009,7 @@ class Dataset(object): ...@@ -1009,7 +1009,7 @@ class Dataset(object):
Parameters Parameters
---------- ----------
data : string, numpy array, pandas DataFrame, H2O DataTable, scipy.sparse or list of numpy arrays data : string, numpy array, pandas DataFrame, H2O DataTable's Frame, scipy.sparse or list of numpy arrays
Data source of Dataset. Data source of Dataset.
If string, it represents the path to txt file. If string, it represents the path to txt file.
label : list, numpy 1-D array, pandas Series / one-column DataFrame or None, optional (default=None) label : list, numpy 1-D array, pandas Series / one-column DataFrame or None, optional (default=None)
...@@ -1399,7 +1399,7 @@ class Dataset(object): ...@@ -1399,7 +1399,7 @@ class Dataset(object):
Returns Returns
------- -------
data : string, numpy array, pandas DataFrame, H2O DataTable, scipy.sparse, list of numpy arrays or None data : string, numpy array, pandas DataFrame, H2O DataTable's Frame, scipy.sparse, list of numpy arrays or None
Raw data used in the Dataset construction. Raw data used in the Dataset construction.
""" """
if self.handle is None: if self.handle is None:
...@@ -2162,7 +2162,7 @@ class Booster(object): ...@@ -2162,7 +2162,7 @@ class Booster(object):
Parameters Parameters
---------- ----------
data : string, numpy array, pandas DataFrame, H2O DataTable or scipy.sparse data : string, numpy array, pandas DataFrame, H2O DataTable's Frame or scipy.sparse
Data source for prediction. Data source for prediction.
If string, it represents the path to txt file. If string, it represents the path to txt file.
num_iteration : int or None, optional (default=None) num_iteration : int or None, optional (default=None)
...@@ -2207,7 +2207,7 @@ class Booster(object): ...@@ -2207,7 +2207,7 @@ class Booster(object):
Parameters Parameters
---------- ----------
data : string, numpy array, pandas DataFrame, H2O DataTable or scipy.sparse data : string, numpy array, pandas DataFrame, H2O DataTable's Frame or scipy.sparse
Data source for refit. Data source for refit.
If string, it represents the path to txt file. If string, it represents the path to txt file.
label : list, numpy 1-D array or pandas Series / one-column DataFrame label : list, numpy 1-D array or pandas Series / one-column DataFrame
......
...@@ -92,7 +92,11 @@ except ImportError: ...@@ -92,7 +92,11 @@ except ImportError:
"""datatable""" """datatable"""
try: try:
from datatable import DataTable import datatable
if hasattr(datatable, "Frame"):
DataTable = datatable.Frame
else:
DataTable = datatable.DataTable
DATATABLE_INSTALLED = True DATATABLE_INSTALLED = True
except ImportError: except ImportError:
DATATABLE_INSTALLED = False DATATABLE_INSTALLED = False
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment