View source: R/saint-predict.R
| predict.brulee_saint | R Documentation |
brulee_saintPredict from a brulee_saint
## S3 method for class 'brulee_saint'
predict(object, new_data, type = NULL, epoch = NULL, ...)
object |
A |
new_data |
A data frame or matrix of new predictors. |
type |
A single character. The type of predictions to generate. Valid options are:
|
epoch |
An integer for the epoch to make predictions. If this value
is larger than the maximum number that was fit, a warning is issued and the
parameters from the last epoch are used. If left |
... |
Not used, but required for extensibility. |
A tibble of predictions. The number of rows in the tibble is guaranteed
to be the same as the number of rows in new_data.
if (torch::torch_is_installed() && rlang::is_installed(c("recipes", "modeldata"))) {
set.seed(87261)
tr_data <- modeldata::sim_classification(500)
te_data <- modeldata::sim_classification(50)
set.seed(2)
fit <- brulee_saint(class ~ ., data = tr_data,
epochs = 50L, batch_size = 64L, stop_iter = 10L,
learn_rate = 0.001)
fit
autoplot(fit)
predict(fit, te_data)
predict(fit, te_data, type = "prob")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.