src/sagemaker_xgboost_container/data_utils.py
def _get_parquet_dmatrix_file_mode(files_path):
    """Get Data Matrix from parquet data in file mode.

    :param files_path: File path where parquet formatted training data resides, either directory or file
    :return: xgb.DMatrix
    """
    try:
        table = pq.read_table(files_path)

        data = table.to_pandas()
        del table

        if type(data) is pd.DataFrame:
            # pyarrow.Table.to_pandas may produce NumPy array or pandas DataFrame
            data = data.to_numpy()

        dmatrix = xgb.DMatrix(data[:, 1:], label=data[:, 0])
        del data

        return dmatrix

    except Exception as e:
        raise exc.UserError("Failed to load parquet data with exception:\n{}".format(e))
Get Data Matrix from parquet data in file mode.

    :param files_path: File path where parquet formatted training data resides, either directory or file
    :return: xgb.DMatrix
    
Get Data Matrix from parquet data in file mode.
Get Data Matrix from parquet data in file mode .
def _get_parquet_dmatrix_file_mode(files_path):
    try:
        table = pq.read_table(files_path)
        data = table.to_pandas()
        del table
        if type(data) is pd.DataFrame:
            data = data.to_numpy()
        dmatrix = xgb.DMatrix(data[:, 1:], label=data[:, 0])
        del data
        return dmatrix
    except Exception as e:
        raise exc.UserError("Failed to load parquet data with exception:\n{}".format(e))
def _get_parquet_dmatrix_file_mode ( files_path ) : try : table = pq . read_table ( files_path ) data = table . to_pandas ( ) del table if type ( data ) is pd . DataFrame : data = data . to_numpy ( ) dmatrix = xgb . DMatrix ( data [ : , 1 : ] , label = data [ : , 0 ] ) del data return dmatrix except Exception as e : raise exc . UserError ( "Failed to load parquet data with exception:\n{}" . format ( e ) )
Get Data Matrix from parquet data in file mode.
Get Data Matrix from parquet data in file mode .
"""Get Data Matrix from parquet data in file mode.

    :param files_path: File path where parquet formatted training data resides, either directory or file
    :return: xgb.DMatrix
    """ # pyarrow.Table.to_pandas may produce NumPy array or pandas DataFrame
None
files_path
File path where parquet formatted training data resides, either directory or file
File path where parquet formatted training data resides either directory or file