Learn R Programming

radiant.model (version 0.8.0)

predict.ann: Predict method for the ann function

Description

Predict method for the ann function

Usage

# S3 method for ann
predict(object, pred_data = "", pred_cmd = "",
  conf_lev = 0.95, se = FALSE, dec = 3, ...)

Arguments

object

Return value from ann

pred_data

Provide the name of a dataframe to generate predictions (e.g., "titanic"). The dataset must contain all columns used in the estimation

pred_cmd

Generate predictions using a command. For example, `pclass = levels(pclass)` would produce predictions for the different levels of factor `pclass`. To add another variable use a `,` (e.g., `pclass = levels(pclass), age = seq(0,100,20)`)

conf_lev

Confidence level used to estimate confidence intervals (.95 is the default)

se

Logical that indicates if prediction standard errors should be calculated (default = FALSE)

dec

Number of decimals to show

...

further arguments passed to or from other methods

Details

See https://radiant-rstats.github.io/docs/model/ann.html for an example in Radiant

See Also

ann to generate the result

summary.ann to summarize results

Examples

Run this code
# NOT RUN {
result <- ann("titanic", "survived", c("pclass","sex"), lev = "Yes")
predict(result, pred_cmd = "pclass = levels(pclass)")
result <- ann("diamonds", "price", "carat:color", type = "regression")
predict(result, pred_cmd = "carat = 1:3")
predict(result, pred_data = "diamonds") %>% head

# }

Run the code above in your browser using DataLab