AutoH2OMLScoring is an automated scoring function that compliments the AutoH2oGBM__() and AutoH2oDRF__() models training functions. This function requires you to supply features for scoring. It will run ModelDataPrep()to prepare your features for H2O data conversion and scoring.
AutoH2OMLScoring(
ScoringData = NULL,
ModelObject = NULL,
ModelType = "mojo",
H2OShutdown = TRUE,
H2OStartUp = TRUE,
MaxMem = { gc()
paste0(as.character(floor(as.numeric(system("awk '/MemFree/ {print $2}' /proc/meminfo",
intern = TRUE))/1e+06)), "G") },
NThreads = max(1, parallel::detectCores() - 2),
JavaOptions = "-Xmx1g -XX:ReservedCodeCacheSize=256m",
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
)
This is your data.table of features for scoring. Can be a single row or batch.
Supply a model object from AutoH2oDRF__()
Set to either "mojo" or "standard" depending on which version you saved
Set to TRUE to shutdown H2O inside the function.
Defaults to TRUE which means H2O will be started inside the function
Set to you dedicated amount of memory. E.g. "28G"
Default set to max(1, parallel::detectCores()-2)
Change the default to your machines specification if needed. Default is '-Xmx1g -XX:ReservedCodeCacheSize=256m',
Supply your path file used in the AutoH2o__() function
Supply the model ID used in the AutoH2o__() function
Set to TRUE to return your features with the predicted values.
Set to TRUE if you have features that were transformed automatically from an Auto__Regression() model AND you haven't already transformed them.
Set to TRUE to generate back-transformed predicted values. Also, if you return features, those will also be back-transformed.
Input your target column name used in training if you are utilizing the transformation service
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.
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().
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.
Set to TRUE if you did so for modeling and didn't do so before supplying ScoringData in this function
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
Set to TRUE if you have date of timestamp columns in your ScoringData
If you set MDP_Impute to TRUE, supply the character values to replace missing values with
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.
Other Automated Model Scoring:
AutoCatBoostScoring()
,
AutoH2OModeler()
,
AutoHurdleScoring()
,
AutoXGBoostScoring()
,
IntermittentDemandScoringDataGenerator()
# NOT RUN {
Preds <- AutoH2OMLScoring(
ScoringData = data,
ModelObject = NULL,
ModelType = "mojo",
H2OShutdown = TRUE,
H2OStartUp = TRUE,
MaxMem = {gc();paste0(as.character(floor(as.numeric(system("awk '/MemFree/ {print $2}' /proc/meminfo", intern=TRUE)) / 1000000)),"G")},
NThreads = max(1, parallel::detectCores()-2),
JavaOptions = '-Xmx1g -XX:ReservedCodeCacheSize=256m',
ModelPath = normalizePath("./"),
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)
# }
Run the code above in your browser using DataLab