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] "linear_reg" "linear_reg_args" #> [17] "linear_reg_encoding" "linear_reg_fit" #> [19] "linear_reg_modes" "linear_reg_pkgs" #> [21] "linear_reg_predict" "logistic_reg" #> [23] "logistic_reg_args" "logistic_reg_encoding" #> [25] "logistic_reg_fit" "logistic_reg_modes" #> [27] "logistic_reg_pkgs" "logistic_reg_predict" #> [29] "mars" "mars_args" #> [31] "mars_encoding" "mars_fit" #> [33] "mars_modes" "mars_pkgs" #> [35] "mars_predict" "mlp" #> [37] "mlp_args" "mlp_encoding" #> [39] "mlp_fit" "mlp_modes" #> [41] "mlp_pkgs" "mlp_predict" #> [43] "models" "modes" #> [45] "multinom_reg" "multinom_reg_args" #> [47] "multinom_reg_encoding" "multinom_reg_fit" #> [49] "multinom_reg_modes" "multinom_reg_pkgs" #> [51] "multinom_reg_predict" "nearest_neighbor" #> [53] "nearest_neighbor_args" "nearest_neighbor_encoding" #> [55] "nearest_neighbor_fit" "nearest_neighbor_modes" #> [57] "nearest_neighbor_pkgs" "nearest_neighbor_predict" #> [59] "null_model" "null_model_args" #> [61] "null_model_encoding" "null_model_fit" #> [63] "null_model_modes" "null_model_pkgs" #> [65] "null_model_predict" "rand_forest" #> [67] "rand_forest_args" "rand_forest_encoding" #> [69] "rand_forest_fit" "rand_forest_modes" #> [71] "rand_forest_pkgs" "rand_forest_predict" #> [73] "surv_reg" "surv_reg_args" #> [75] "surv_reg_encoding" "surv_reg_fit" #> [77] "surv_reg_modes" "surv_reg_pkgs" #> [79] "surv_reg_predict" "svm_poly" #> [81] "svm_poly_args" "svm_poly_encoding" #> [83] "svm_poly_fit" "svm_poly_modes" #> [85] "svm_poly_pkgs" "svm_poly_predict" #> [87] "svm_rbf" "svm_rbf_args" #> [89] "svm_rbf_encoding" "svm_rbf_fit" #> [91] "svm_rbf_modes" "svm_rbf_pkgs" #> [93] "svm_rbf_predict"