A machine learning function for making predictions using XGBoost models.
More...
#include <XGBoost.h>
|
| | XGBoostPrediction (std::string forestPath, int numFeatures) |
| | Construct a new XGBoostPrediction object.
|
| |
| void | apply (const SelectivityVector &rows, std::vector< VectorPtr > &args, const TypePtr &type, exec::EvalCtx &context, VectorPtr &output) const override |
| | Apply the function to make predictions.
|
| |
| float * | getTensor () const override |
| | Get the tensor data.
|
| |
| int | getNumFeatures () |
| | Get the number of features.
|
| |
| std::string & | getForestPath () |
| | Get the path to the XGBoost model file.
|
| |
|
virtual | ~MLFunction ()=default |
| | Virtual destructor.
|
| |
| virtual std::vector< int > | getDims () |
| | Returns the dimensions of the function.
|
| |
| virtual std::string | getFuncName () |
| | Returns the name of the function.
|
| |
| virtual int | getNumDims () |
| | Returns the number of dimensions of the function.
|
| |
| virtual CostEstimate | getCost (std::vector< int > inputDims) |
| | Estimates the computational cost of applying the function.
|
| |
|
| static std::vector< std::shared_ptr< exec::FunctionSignature > > | signatures () |
| | Get the function signatures.
|
| |
| static std::string | getName () |
| | Get the name of the function.
|
| |
|
| double | getWeightedCost (std::string name, float cost) |
| | Calculates the weighted cost of the function.
|
| |
| std::vector< double > | getCoefficientVector (std::string name) |
| | Retrieves the cost coefficients for the function.
|
| |
|
std::vector< int > | dims |
| | Dimensions of the function.
|
| |
A machine learning function for making predictions using XGBoost models.
◆ XGBoostPrediction()
| ml::XGBoostPrediction::XGBoostPrediction |
( |
std::string | forestPath, |
|
|
int | numFeatures ) |
|
inline |
Construct a new XGBoostPrediction object.
- Parameters
-
| forestPath | The path to the XGBoost model file. |
| numFeatures | The number of features in the input data. |
◆ apply()
| void ml::XGBoostPrediction::apply |
( |
const SelectivityVector & | rows, |
|
|
std::vector< VectorPtr > & | args, |
|
|
const TypePtr & | type, |
|
|
exec::EvalCtx & | context, |
|
|
VectorPtr & | output ) const |
|
inlineoverride |
Apply the function to make predictions.
- Parameters
-
| rows | The selectivity vector indicating which rows to process. |
| args | The input arguments to the function. |
| type | The type of the output vector. |
| context | The evaluation context. |
| output | The output vector where the results will be stored. |
◆ getForestPath()
| std::string & ml::XGBoostPrediction::getForestPath |
( |
| ) |
|
|
inline |
Get the path to the XGBoost model file.
- Returns
- A reference to the path string.
◆ getName()
| static std::string ml::XGBoostPrediction::getName |
( |
| ) |
|
|
inlinestatic |
Get the name of the function.
- Returns
- A string representing the name of the function.
◆ getNumFeatures()
| int ml::XGBoostPrediction::getNumFeatures |
( |
| ) |
|
|
inline |
Get the number of features.
- Returns
- The number of features in the input data.
◆ getTensor()
| float * ml::XGBoostPrediction::getTensor |
( |
| ) |
const |
|
inlineoverridevirtual |
Get the tensor data.
- Returns
- A pointer to the tensor data.
- Note
- This implementation may lead to a memory leak.
Implements MLFunction.
◆ signatures()
| static std::vector< std::shared_ptr< exec::FunctionSignature > > ml::XGBoostPrediction::signatures |
( |
| ) |
|
|
inlinestatic |
Get the function signatures.
- Returns
- A vector of shared pointers to function signatures.
The documentation for this class was generated from the following file: