These functions read and write to the environment where the package stores information about model specifications.

get_model_env()

get_from_env(items)

set_in_env(...)

set_env_val(name, value)

Arguments

items

A character string of objects in the model environment.

...

Named values that will be assigned to the model environment.

name

A single character value for a new symbol in the model environment.

value

A single value for a new value in the model environment.

References

"How to build a parsnip model" https://www.tidymodels.org/learn/develop/models/

Examples

# Access the model data: current_code <- get_model_env() ls(envir = current_code)
#> [1] "boost_tree" "boost_tree_args" #> [3] "boost_tree_encoding" "boost_tree_fit" #> [5] "boost_tree_modes" "boost_tree_pkgs" #> [7] "boost_tree_predict" "decision_tree" #> [9] "decision_tree_args" "decision_tree_encoding" #> [11] "decision_tree_fit" "decision_tree_modes" #> [13] "decision_tree_pkgs" "decision_tree_predict" #> [15] "gen_additive_mod" "gen_additive_mod_args" #> [17] "gen_additive_mod_encoding" "gen_additive_mod_fit" #> [19] "gen_additive_mod_modes" "gen_additive_mod_pkgs" #> [21] "gen_additive_mod_predict" "linear_reg" #> [23] "linear_reg_args" "linear_reg_encoding" #> [25] "linear_reg_fit" "linear_reg_modes" #> [27] "linear_reg_pkgs" "linear_reg_predict" #> [29] "logistic_reg" "logistic_reg_args" #> [31] "logistic_reg_encoding" "logistic_reg_fit" #> [33] "logistic_reg_modes" "logistic_reg_pkgs" #> [35] "logistic_reg_predict" "mars" #> [37] "mars_args" "mars_encoding" #> [39] "mars_fit" "mars_modes" #> [41] "mars_pkgs" "mars_predict" #> [43] "mlp" "mlp_args" #> [45] "mlp_encoding" "mlp_fit" #> [47] "mlp_modes" "mlp_pkgs" #> [49] "mlp_predict" "models" #> [51] "modes" "multinom_reg" #> [53] "multinom_reg_args" "multinom_reg_encoding" #> [55] "multinom_reg_fit" "multinom_reg_modes" #> [57] "multinom_reg_pkgs" "multinom_reg_predict" #> [59] "nearest_neighbor" "nearest_neighbor_args" #> [61] "nearest_neighbor_encoding" "nearest_neighbor_fit" #> [63] "nearest_neighbor_modes" "nearest_neighbor_pkgs" #> [65] "nearest_neighbor_predict" "null_model" #> [67] "null_model_args" "null_model_encoding" #> [69] "null_model_fit" "null_model_modes" #> [71] "null_model_pkgs" "null_model_predict" #> [73] "proportional_hazards" "proportional_hazards_args" #> [75] "proportional_hazards_fit" "proportional_hazards_modes" #> [77] "proportional_hazards_pkgs" "proportional_hazards_predict" #> [79] "rand_forest" "rand_forest_args" #> [81] "rand_forest_encoding" "rand_forest_fit" #> [83] "rand_forest_modes" "rand_forest_pkgs" #> [85] "rand_forest_predict" "surv_reg" #> [87] "surv_reg_args" "surv_reg_encoding" #> [89] "surv_reg_fit" "surv_reg_modes" #> [91] "surv_reg_pkgs" "surv_reg_predict" #> [93] "survival_reg" "survival_reg_args" #> [95] "survival_reg_fit" "survival_reg_modes" #> [97] "survival_reg_pkgs" "survival_reg_predict" #> [99] "svm_linear" "svm_linear_args" #> [101] "svm_linear_encoding" "svm_linear_fit" #> [103] "svm_linear_modes" "svm_linear_pkgs" #> [105] "svm_linear_predict" "svm_poly" #> [107] "svm_poly_args" "svm_poly_encoding" #> [109] "svm_poly_fit" "svm_poly_modes" #> [111] "svm_poly_pkgs" "svm_poly_predict" #> [113] "svm_rbf" "svm_rbf_args" #> [115] "svm_rbf_encoding" "svm_rbf_fit" #> [117] "svm_rbf_modes" "svm_rbf_pkgs" #> [119] "svm_rbf_predict"