View source: R/AutoXGBoostScoring.R
AutoXGBoostScoring | R Documentation |
AutoXGBoostScoring is an automated scoring function that compliments the AutoXGBoost model training functions. This function requires you to supply features for scoring. It will run ModelDataPrep() and the DummifyDT() function to prepare your features for xgboost data conversion and scoring.
AutoXGBoostScoring(
TargetType = NULL,
ScoringData = NULL,
ReturnShapValues = FALSE,
FeatureColumnNames = NULL,
IDcols = NULL,
EncodingMethod = "binary",
FactorLevelsList = NULL,
TargetLevels = NULL,
OneHot = FALSE,
ModelObject = NULL,
ModelPath = NULL,
ModelID = NULL,
ReturnFeatures = TRUE,
TransformNumeric = FALSE,
BackTransNumeric = FALSE,
TargetColumnName = NULL,
TransformationObject = NULL,
TransID = NULL,
TransPath = NULL,
MDP_Impute = TRUE,
MDP_CharToFactor = TRUE,
MDP_RemoveDates = TRUE,
MDP_MissFactor = "0",
MDP_MissNum = -1,
Debug = FALSE
)
TargetType |
Set this value to "regression", "classification", or "multiclass" to score models built using AutoXGBoostRegression(), AutoXGBoostClassify() or AutoXGBoostMultiClass() |
ScoringData |
This is your data.table of features for scoring. Can be a single row or batch. |
ReturnShapValues |
Set to TRUE to return shap values for the predicted values |
FeatureColumnNames |
Supply either column names or column numbers used in the AutoXGBoost__() function |
IDcols |
Supply ID column numbers for any metadata you want returned with your predicted values |
EncodingMethod |
Choose from 'binary', 'm_estimator', 'credibility', 'woe', 'target_encoding', 'poly_encode', 'backward_difference', 'helmert' |
FactorLevelsList |
Supply the factor variables' list from DummifyDT() |
TargetLevels |
Supply the target levels output from AutoXGBoostMultiClass() or the scoring function will go looking for it in the file path you supply. |
ModelObject |
Supply a model for scoring, otherwise it will have to search for it in the file path you specify |
ModelPath |
Supply your path file used in the AutoXGBoost__() function |
ModelID |
Supply the model ID used in the AutoXGBoost__() function |
ReturnFeatures |
Set to TRUE to return your features with the predicted values. |
TransformNumeric |
Set to TRUE if you have features that were transformed automatically from an Auto__Regression() model AND you haven't already transformed them. |
BackTransNumeric |
Set to TRUE to generate back-transformed predicted values. Also, if you return features, those will also be back-transformed. |
TargetColumnName |
Input your target column name used in training if you are utilizing the transformation service |
TransformationObject |
Set to NULL if you didn't use transformations or if you want the function to pull from the file output from the Auto__Regression() function. You can also supply the transformation data.table object with the transformation details versus having it pulled from file. |
TransID |
Set to the ID used for saving the transformation data.table object or set it to the ModelID if you are pulling from file from a build with Auto__Regression(). |
TransPath |
Set the path file to the folder where your transformation data.table detail object is stored. If you used the Auto__Regression() to build, set it to the same path as ModelPath. |
MDP_Impute |
Set to TRUE if you did so for modeling and didn't do so before supplying ScoringData in this function |
MDP_CharToFactor |
Set to TRUE to turn your character columns to factors if you didn't do so to your ScoringData that you are supplying to this function |
MDP_RemoveDates |
Set to TRUE if you have date of timestamp columns in your ScoringData |
MDP_MissFactor |
If you set MDP_Impute to TRUE, supply the character values to replace missing values with |
MDP_MissNum |
If you set MDP_Impute to TRUE, supply a numeric value to replace missing values with |
A data.table of predicted values with the option to return model features as well.
Adrian Antico
Other Automated Model Scoring:
AutoCatBoostScoring()
,
AutoH2OMLScoring()
,
AutoLightGBMScoring()
## Not run:
Preds <- AutoXGBoostScoring(
TargetType = "regression",
ScoringData = data,
ReturnShapValues = FALSE,
FeatureColumnNames = 2:12,
IDcols = NULL,
EncodingMethod = "binary",
FactorLevelsList = NULL,
TargetLevels = NULL,
ModelObject = NULL,
ModelPath = "home",
ModelID = "ModelTest",
ReturnFeatures = TRUE,
TransformNumeric = FALSE,
BackTransNumeric = FALSE,
TargetColumnName = NULL,
TransformationObject = NULL,
TransID = NULL,
TransPath = NULL,
MDP_Impute = TRUE,
MDP_CharToFactor = TRUE,
MDP_RemoveDates = TRUE,
MDP_MissFactor = "0",
MDP_MissNum = -1)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.