Skip to content

Commit 2e5d3fa

Browse files
authored
Merge pull request #247 from tidymodels/devel
use modeldata package and data treatment in predict
2 parents 1c2612a + a7c3cb7 commit 2e5d3fa

24 files changed

+20
-244
lines changed

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,5 @@ Suggests:
4949
ranger,
5050
rpart,
5151
MASS,
52-
nlme
52+
nlme,
53+
modeldata

R/data.R

Lines changed: 0 additions & 105 deletions
This file was deleted.

R/descriptors.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#'
5959
#' \preformatted{
6060
#'
61+
#' library(modeldata)
6162
#' data("lending_club")
6263
#'
6364
#' rand_forest(mode = "classification", mtry = .cols() - 2)

R/fit.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#' # methods for specifying the model can be used
4949
#'
5050
#' library(dplyr)
51+
#' library(modeldata)
5152
#' data("lending_club")
5253
#'
5354
#' lr_mod <- logistic_reg()

R/predict.R

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,12 @@ prepare_data <- function(object, new_data) {
229229
new_data <- convert_form_to_xy_new(object$preproc, new_data)$x
230230
}
231231
}
232-
233-
new_data
232+
switch(
233+
fit_interface,
234+
none = new_data,
235+
data.frame = as.data.frame(new_data),
236+
matrix = as.matrix(new_data),
237+
new_data
238+
)
234239
}
235240

data/check_times.rda

-355 KB
Binary file not shown.

data/datalist

Lines changed: 0 additions & 3 deletions
This file was deleted.

data/lending_club.rda

-150 KB
Binary file not shown.

data/wa_churn.rda

-89.7 KB
Binary file not shown.

man/check_times.Rd

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)