predict_target: Predict target using a trained model.

View source: R/explain.R

predict_targetR Documentation

Predict target using a trained model.

Description

Predict target using a trained model.

Usage

predict_target(data, model, name = "prediction")

Arguments

data

A dataset (data.frame or tbl)

model

A model created with ⁠explain_*()⁠ function

name

Prefix of variable-name for prediction

Value

data containing predicted probabilities for target values

Examples


data_train <- create_data_buy(seed = 1)
data_test <- create_data_buy(seed = 2)
model <- explain_tree(data_train, target = buy, out = "model")
data <- predict_target(data = data_test, model = model)
describe(data)


explore documentation built on Sept. 11, 2024, 7:40 p.m.