Skip to contents

Scores new casualties with an sdt_fit() model. The return is always a tibble, whatever the engine, so downstream code does not have to branch on which model produced it.

Usage

# S3 method for class 'sdt_model'
predict(object, new_data, ...)

Arguments

object

An sdt_model from sdt_fit().

new_data

A data frame of casualties to score.

...

Passed to the underlying stats::predict() method; type = "prob" returns class probabilities rather than a hard call.

Value

A tibble::tibble() with one row per row of new_data.

See also

sdt_predictions() for the held-out predictions the model's own metrics were computed from.

Examples

# See ?sdt_fit for a runnable example.
sdt_engines()
#> # A tibble: 9 × 4
#>   engine      package class_box installed
#>   <chr>       <chr>   <chr>     <lgl>    
#> 1 tree        rpart   glass     TRUE     
#> 2 multinom    nnet    glass     TRUE     
#> 3 glmnet      glmnet  glass     TRUE     
#> 4 mars        earth   grey      TRUE     
#> 5 xgboost     xgboost grey      TRUE     
#> 6 ranger      ranger  black     TRUE     
#> 7 svm_rbf     kernlab black     TRUE     
#> 8 mlp         nnet    black     TRUE     
#> 9 transformer keras3  closed    TRUE