跳到内容

获取 DMatrix 数据

用法

xgb.get.DMatrix.data(dmat)

参数

dmat

一个 xgb.DMatrix 对象,由 xgb.DMatrix() 返回。

返回值

DMatrix 中持有的数据,以稀疏 CSR 矩阵形式(来自 Matrix 包的 dgRMatrix 类)。如果它包含特征名称,这些名称将作为列名添加到输出中。