Global Settings

Core default behaviors of functions in the package can be viewed or changed globally through the settings() function. The function accepts one or more character names of settings to view, name = value pairs giving the values of settings to change, a vector of these, or "reset" to restore all package defaults. Calls with no arguments will display the current values of all. Settings may also be supplied as a single unnamed argument which is a named list. Partial matching of setting names is supported. The setting value is returned if only one is specified to view. Otherwise, a list is returned with the values of specified settings as they existed prior to any requested changes. Such a list can be passed as an argument to settings to restore their values.

## Package library
library(MachineShop)

## View all current settings
settings()
#> $control
#> [1] "CVControl"
#> 
#> $cutoff
#> [1] 0.5
#> 
#> $distr.SurvMeans
#> [1] "weibull"
#> 
#> $distr.SurvProbs
#> [1] "empirical"
#> 
#> $grid
#> --- TuningGrid object -------------------------------------------------------------------------
#> 
#> Grid size: 3
#> Random samples: FALSE
#> 
#> $method.EmpiricalSurv
#> [1] "efron"
#> 
#> $metrics
#>  [1] "accuracy"        "auc"             "brier"           "cindex"         
#>  [5] "cross_entropy"   "f_score"         "fnr"             "fpr"            
#>  [9] "gini"            "kappa2"          "mae"             "mse"            
#> [13] "msle"            "npv"             "ppr"             "ppv"            
#> [17] "pr_auc"          "precision"       "r2"              "recall"         
#> [21] "rmse"            "rmsle"           "roc_auc"         "roc_index"      
#> [25] "sensitivity"     "specificity"     "tnr"             "tpr"            
#> [29] "weighted_kappa2"
#> 
#> $metrics.ConfusionMatrix
#>          Accuracy             Kappa    Weighted Kappa       Sensitivity 
#>        "accuracy"          "kappa2" "weighted_kappa2"     "sensitivity" 
#>       Specificity 
#>     "specificity" 
#> 
#> $metrics.factor
#>             Brier          Accuracy             Kappa    Weighted Kappa 
#>           "brier"        "accuracy"          "kappa2" "weighted_kappa2" 
#>           ROC AUC       Sensitivity       Specificity 
#>         "roc_auc"     "sensitivity"     "specificity" 
#> 
#> $metrics.matrix
#>   RMSE     R2    MAE 
#> "rmse"   "r2"  "mae" 
#> 
#> $metrics.numeric
#>   RMSE     R2    MAE 
#> "rmse"   "r2"  "mae" 
#> 
#> $metrics.Surv
#>    C-Index      Brier    ROC AUC   Accuracy 
#>   "cindex"    "brier"  "roc_auc" "accuracy" 
#> 
#> $models
#>  [1] "AdaBagModel"         "AdaBoostModel"       "BARTMachineModel"   
#>  [4] "BARTModel"           "BlackBoostModel"     "C50Model"           
#>  [7] "CForestModel"        "CoxModel"            "CoxStepAICModel"    
#> [10] "EarthModel"          "FDAModel"            "GAMBoostModel"      
#> [13] "GBMModel"            "GLMBoostModel"       "GLMModel"           
#> [16] "GLMStepAICModel"     "GLMNetModel"         "KNNModel"           
#> [19] "LARSModel"           "LDAModel"            "LMModel"            
#> [22] "MDAModel"            "NaiveBayesModel"     "NNetModel"          
#> [25] "ParsnipModel"        "PDAModel"            "PLSModel"           
#> [28] "POLRModel"           "QDAModel"            "RandomForestModel"  
#> [31] "RangerModel"         "RFSRCModel"          "RPartModel"         
#> [34] "SelectedModel"       "StackedModel"        "SuperModel"         
#> [37] "SurvRegModel"        "SurvRegStepAICModel" "SVMModel"           
#> [40] "SVMANOVAModel"       "SVMBesselModel"      "SVMLaplaceModel"    
#> [43] "SVMLinearModel"      "SVMPolyModel"        "SVMRadialModel"     
#> [46] "SVMSplineModel"      "SVMTanhModel"        "TreeModel"          
#> [49] "TunedModel"          "XGBModel"            "XGBDARTModel"       
#> [52] "XGBLinearModel"      "XGBTreeModel"       
#> 
#> $print_max
#> [1] 10
#> 
#> $require
#> [1] "MachineShop"
#> 
#> $reset
#> character(0)
#> 
#> $response_types
#>  [1] "binary"             "BinomialVariate"    "DiscreteVariate"   
#>  [4] "factor"             "matrix"             "NegBinomialVariate"
#>  [7] "numeric"            "ordered"            "PoissonVariate"    
#> [10] "Surv"              
#> 
#> $RHS.formula
#>  [1] "!"        "!="       "%%"       "%/%"      "%in%"     "&"       
#>  [7] "("        "*"        "+"        "-"        "."        "/"       
#> [13] ":"        "<"        "<="       "=="       ">"        ">="      
#> [19] "I"        "^"        "abs"      "acos"     "acosh"    "asin"    
#> [25] "asinh"    "atan"     "atanh"    "ceiling"  "cos"      "cosh"    
#> [31] "cospi"    "digamma"  "exp"      "expm1"    "floor"    "gamma"   
#> [37] "lgamma"   "log"      "log1p"    "offset"   "round"    "sign"    
#> [43] "signif"   "sin"      "sinh"     "sinpi"    "sqrt"     "tan"     
#> [49] "tanh"     "tanpi"    "trigamma" "trunc"    "|"       
#> 
#> $stat.Curve
#> [1] "base::mean"
#> 
#> $stat.Resample
#> [1] "base::mean"
#> 
#> $stat.TrainingParams
#> [1] "base::mean"
#> 
#> $stats.PartialDependence
#>         Mean 
#> "base::mean" 
#> 
#> $stats.Resample
#>            Mean          Median              SD             Min             Max 
#>    "base::mean" "stats::median"     "stats::sd"     "base::min"     "base::max"

## Change settings
presets <- settings(control = "BootControl", grid = 10)

## View one setting
settings("control")
#> [1] "BootControl"

## View multiple settings
settings("control", "grid")
#> $control
#> [1] "BootControl"
#> 
#> $grid
#> --- TuningGrid object -------------------------------------------------------------------------
#> 
#> Grid size: 10
#> Random samples: FALSE

## Restore the previous settings
settings(presets)