Skip to content

Commit 1f5b6f1

Browse files
committed
Missing docs for update
1 parent 79f8c9f commit 1f5b6f1

File tree

4 files changed

+129
-0
lines changed

4 files changed

+129
-0
lines changed

R/logistic_reg.R

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,24 @@ finalize.logistic_reg <- function(x, engine = NULL, ...) {
285285

286286
###################################################################
287287

288+
#' Update a Logistic Regression Specification
289+
#'
290+
#' If parameters need to be modified, this function can be used
291+
#' in lieu of recreating the object from scratch.
292+
#'
288293
#' @export
294+
#' @inheritParams logistic_reg
295+
#' @param object A logistic reression model specification.
296+
#' @param fresh A logical for whether the arguments should be
297+
#' modifed in-place of or replaced wholesale.
298+
#' @return An updated model specification.
299+
#' @examples
300+
#' model <- logistic_reg(regularization = 10, mixture = 0.1)
301+
#' model
302+
#'
303+
#' update(model, regularization = 1)
304+
#'
305+
#' update(model, regularization = 1, fresh = TRUE)
289306
update.logistic_reg <-
290307
function(object,
291308
regularization = NULL, mixture = NULL,

R/rand_forest.R

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,24 @@ finalize.rand_forest <- function(x, engine = NULL, ...) {
371371

372372
###################################################################
373373

374+
#' Update a Random Forest Specification
375+
#'
376+
#' If parameters need to be modified, this function can be used
377+
#' in lieu of recreating the object from scratch.
378+
#'
374379
#' @export
380+
#' @inheritParams rand_forest
381+
#' @param object A random forest model specification.
382+
#' @param fresh A logical for whether the arguments should be
383+
#' modifed in-place of or replaced wholesale.
384+
#' @return An updated model specification.
385+
#' @examples
386+
#' model <- rand_forest(mtry = 10, min_n = 3)
387+
#' model
388+
#'
389+
#' update(model, mtry = 1)
390+
#'
391+
#' update(model, mtry = 1, fresh = TRUE)
375392
update.rand_forest <-
376393
function(object,
377394
mtry = NULL, trees = NULL, min_n = NULL,

man/update.logistic_reg.Rd

Lines changed: 47 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/update.rand_forest.Rd

Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)