| xgboost | 
这些函数用于运行预测和解释算法。更多...

| 函数 | |
| int | XGBoosterPredict (BoosterHandle handle, DMatrixHandle dmat, int option_mask, unsigned ntree_limit, int training, bst_ulong *out_len, const float **out_result) | 
| 基于dmat进行预测(已弃用,请改用XGBoosterPredictFromDMatrix)更多... | |
| int | XGBoosterPredictFromDMatrix (BoosterHandle handle, DMatrixHandle dmat, char const *config, bst_ulong const **out_shape, bst_ulong *out_dim, float const **out_result) | 
| 从DMatrix进行预测,取代XGBoosterPredict。更多... | |
| int | XGBoosterPredictFromDense (BoosterHandle handle, char const *values, char const *config, DMatrixHandle m, bst_ulong const **out_shape, bst_ulong *out_dim, const float **out_result) | 
| 从CPU密集矩阵进行就地预测。更多... | |
| int | XGBoosterPredictFromColumnar (BoosterHandle handle, char const *values, char const *config, DMatrixHandle m, bst_ulong const **out_shape, bst_ulong *out_dim, const float **out_result) | 
| 从CPU列式数据(表)进行就地预测。更多... | |
| int | XGBoosterPredictFromCSR (BoosterHandle handle, char const *indptr, char const *indices, char const *values, bst_ulong ncol, char const *config, DMatrixHandle m, bst_ulong const **out_shape, bst_ulong *out_dim, const float **out_result) | 
| 从CPU CSR矩阵进行就地预测。更多... | |
| int | XGBoosterPredictFromCudaArray (BoosterHandle handle, char const *values, char const *config, DMatrixHandle proxy, bst_ulong const **out_shape, bst_ulong *out_dim, const float **out_result) | 
| 从CUDA密集矩阵(Python中的cupy)进行就地预测。更多... | |
| int | XGBoosterPredictFromCudaColumnar (BoosterHandle handle, char const *data, char const *config, DMatrixHandle proxy, bst_ulong const **out_shape, bst_ulong *out_dim, const float **out_result) | 
| 从CUDA密集数据帧(Python中的cuDF)进行就地预测。更多... | |
这些函数用于运行预测和解释算法。
| int XGBoosterPredict | ( | BoosterHandle | handle, | 
| DMatrixHandle | dmat, | ||
| int | option_mask, | ||
| unsigned | ntree_limit, | ||
| int | training, | ||
| bst_ulong * | out_len, | ||
| const float ** | out_result | ||
| ) | 
基于dmat进行预测(已弃用,请改用XGBoosterPredictFromDMatrix)
| handle | handle | 
| dmat | 数据矩阵 | 
| option_mask | 预测中使用的选项位掩码,可能的值 0:普通预测 1:输出边距而非转换值 2:输出树的叶索引而非叶值,请注意叶索引在每棵树中是唯一的 4:输出特征对个体预测的贡献 | 
| ntree_limit | 限制用于预测的树的数量,这仅在参数设置为0时对提升树有效,我们将使用所有树 | 
| training | 预测函数是否作为训练循环的一部分使用。预测可以在两种情况下运行 
 | 
| out_len | 用于存储返回结果的长度 | 
| out_result | 用于设置指向数组的指针 | 
| int XGBoosterPredictFromColumnar | ( | BoosterHandle | handle, | 
| char const * | values, | ||
| char const * | config, | ||
| DMatrixHandle | m, | ||
| bst_ulong const ** | out_shape, | ||
| bst_ulong * | out_dim, | ||
| const float ** | out_result | ||
| ) | 
从 CPU 列式数据(表)进行就地预测。
| handle | 增强器句柄。 | 
| 数据 | 有关更多信息,请参阅XGDMatrixCreateFromColumnar。 | 
| config | 有关更多信息,请参阅XGBoosterPredictFromDMatrix。就地预测的其他字段是 
 | 
| m | 一个可选的(如果不可用则为NULL)代理DMatrix实例,用于存储元信息。 | 
| out_shape | 有关更多信息,请参阅XGBoosterPredictFromDMatrix。 | 
| out_dim | 有关更多信息,请参阅XGBoosterPredictFromDMatrix。 | 
| out_result | 有关更多信息,请参阅XGBoosterPredictFromDMatrix。 | 
| int XGBoosterPredictFromCSR | ( | BoosterHandle | handle, | 
| char const * | indptr, | ||
| char const * | indices, | ||
| char const * | values, | ||
| bst_ulong | ncol, | ||
| char const * | config, | ||
| DMatrixHandle | m, | ||
| bst_ulong const ** | out_shape, | ||
| bst_ulong * | out_dim, | ||
| const float ** | out_result | ||
| ) | 
从 CPU CSR 矩阵进行就地预测。
| handle | 增强器句柄。 | 
| indptr | JSON编码的CSR中行指针的array_interface。 | 
| indices | JSON编码的CSR中列索引的array_interface。 | 
| values | JSON编码的CSR中值的array_interface。 | 
| ncol | 数据中的特征数量。 | 
| config | 有关更多信息,请参阅XGBoosterPredictFromDMatrix。就地预测的其他字段是 
 | 
| m | 一个可选的(如果不可用则为NULL)代理DMatrix实例,用于存储元信息。 | 
| out_shape | 有关更多信息,请参阅XGBoosterPredictFromDMatrix。 | 
| out_dim | 有关更多信息,请参阅XGBoosterPredictFromDMatrix。 | 
| out_result | 有关更多信息,请参阅XGBoosterPredictFromDMatrix。 | 
| int XGBoosterPredictFromCudaArray | ( | BoosterHandle | handle, | 
| char const * | values, | ||
| char const * | config, | ||
| DMatrixHandle | proxy, | ||
| bst_ulong const ** | out_shape, | ||
| bst_ulong * | out_dim, | ||
| const float ** | out_result | ||
| ) | 
从 CUDA 稠密矩阵(Python 中的 cupy)进行就地预测。
| handle | 增强器句柄 | 
| values | JSON编码的cuda_array_interface值。 | 
| config | 有关更多信息,请参阅XGBoosterPredictFromDMatrix。就地预测的其他字段是 
 | 
| proxy | 一个可选的(如果不可用则为NULL)代理DMatrix实例,用于存储元信息。 | 
| out_shape | 有关更多信息,请参阅XGBoosterPredictFromDMatrix。 | 
| out_dim | 有关更多信息,请参阅XGBoosterPredictFromDMatrix。 | 
| out_result | 有关更多信息,请参阅XGBoosterPredictFromDMatrix。 | 
| int XGBoosterPredictFromCudaColumnar | ( | BoosterHandle | handle, | 
| char const * | 数据, | ||
| char const * | config, | ||
| DMatrixHandle | proxy, | ||
| bst_ulong const ** | out_shape, | ||
| bst_ulong * | out_dim, | ||
| const float ** | out_result | ||
| ) | 
从 CUDA 稠密数据帧(Python 中的 cuDF)进行就地预测。
| handle | 增强器句柄 | 
| 数据 | 有关更多信息,请参阅XGDMatrixCreateFromColumnar。 | 
| config | 有关更多信息,请参阅XGBoosterPredictFromDMatrix。就地预测的其他字段是 
 | 
| proxy | 一个可选的(如果不可用则为NULL)代理DMatrix实例,用于存储元信息。 | 
| out_shape | 有关更多信息,请参阅XGBoosterPredictFromDMatrix。 | 
| out_dim | 有关更多信息,请参阅XGBoosterPredictFromDMatrix。 | 
| out_result | 有关更多信息,请参阅XGBoosterPredictFromDMatrix。 | 
| int XGBoosterPredictFromDense | ( | BoosterHandle | handle, | 
| char const * | values, | ||
| char const * | config, | ||
| DMatrixHandle | m, | ||
| bst_ulong const ** | out_shape, | ||
| bst_ulong * | out_dim, | ||
| const float ** | out_result | ||
| ) | 
从CPU稠密矩阵进行就地预测。
| handle | 增强器句柄。 | 
| values | JSON编码的array_interface值。 | 
| config | 有关更多信息,请参阅XGBoosterPredictFromDMatrix。就地预测的其他字段是 
 | 
| m | 一个可选的(如果不可用则为NULL)代理DMatrix实例,用于存储元信息。 | 
| out_shape | 有关更多信息,请参阅XGBoosterPredictFromDMatrix。 | 
| out_dim | 有关更多信息,请参阅XGBoosterPredictFromDMatrix。 | 
| out_result | 有关更多信息,请参阅XGBoosterPredictFromDMatrix。 | 
| int XGBoosterPredictFromDMatrix | ( | BoosterHandle | handle, | 
| DMatrixHandle | dmat, | ||
| char const * | config, | ||
| bst_ulong const ** | out_shape, | ||
| bst_ulong * | out_dim, | ||
| float const ** | out_result | ||
| ) | 
从DMatrix进行预测,取代XGBoosterPredict。
| handle | 增强器句柄 | 
| dmat | DMatrix句柄 | 
| config | JSON格式的字符串编码预测配置,JSON对象中包含以下可用字段 | 
"type": [0, 6]
预测可以在两种情况下运行
运行具有严格输出形状的普通预测的JSON输入示例,软概率为2维,其他为1维。
| out_shape | 输出预测的形状(使用前复制)。 | 
| out_dim | 输出预测的维度。 | 
| out_result | 存储预测值的缓冲区(使用前复制)。 |