Skip to content

Commit ef96a46

Browse files
committed
updated vignette for custom models
1 parent 75f5c47 commit ef96a46

File tree

4 files changed

+145
-152
lines changed

4 files changed

+145
-152
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: parsnip
2-
Version: 0.0.2
2+
Version: 0.0.2.9000
33
Title: A Common API to Modeling and Analysis Functions
44
Description: A common interface is provided to allow users to specify a model without having to remember the different argument names across different functions or computational engines (e.g. 'R', 'Spark', 'Stan', etc).
55
Authors@R: c(

NEWS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## Breaking Changes
44

5-
* The method that `parsnip` stores the model information has changed. Any custom models from previous versions will need to use the new method for registering models.
5+
* The method that `parsnip` stores the model information has changed. Any custom models from previous versions will need to use the new method for registering models. The methods are detailed in `?get_model_env()` and the [package vignette for adding models](https://tidymodels.github.io/parsnip/articles/articles/Scratch.html).
66
* The mode need to be declared for models that can be used for more than one mode prior to fitting and/or translation).
7-
* For `surv_reg()`, the engine that uses the `survival` package is now called `survival` instead of `survreg`.
7+
* For `surv_reg()`, the engine that uses the `survival` package is now called `survival` instead of `survreg`.
88

99
## New Features
1010

R/aaa_models.R

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ get_model_env <- function() {
108108
#' show_model_info("rand_forest")
109109
#'
110110
#' # Access the model data:
111-
#'
112111
#' current_code <- get_model_env()
113112
#' ls(envir = current_code)
114113
#'
@@ -653,7 +652,7 @@ show_model_info <- function(model) {
653652
cat(sep = "")
654653
cat("\n")
655654
} else {
656-
cat(" no registered engines yet.")
655+
cat(" no registered engines.\n\n")
657656
}
658657

659658
args <- current[[paste0(model, "_args")]]
@@ -677,7 +676,7 @@ show_model_info <- function(model) {
677676
cat(sep = "")
678677
cat("\n")
679678
} else {
680-
cat(" no registered arguments yet.")
679+
cat(" no registered arguments.\n\n")
681680
}
682681

683682
fits <- current[[paste0(model, "_fit")]]
@@ -690,7 +689,7 @@ show_model_info <- function(model) {
690689
print(row.names = FALSE)
691690
cat("\n")
692691
} else {
693-
cat(" no registered fit modules yet.")
692+
cat(" no registered fit modules.\n\n")
694693
}
695694

696695
preds <- current[[paste0(model, "_predict")]]
@@ -705,7 +704,7 @@ show_model_info <- function(model) {
705704
print(row.names = FALSE)
706705
cat("\n")
707706
} else {
708-
cat(" no registered prediction modules yet.")
707+
cat(" no registered prediction modules.\n\n")
709708
}
710709

711710

0 commit comments

Comments
 (0)