Last chance! 50% off unlimited learning
Sale ends in
Predict method for the nn function
# S3 method for nn
predict(object, pred_data = NULL, pred_cmd = "",
dec = 3, ...)
Return value from nn
Provide the dataframe to generate predictions (e.g., diamonds). The dataset must contain all columns used in the estimation
Generate predictions using a command. For example, `pclass = levels(pclass)` would produce predictions for the different levels of factor `pclass`. To add another variable, create a vector of prediction strings, (e.g., c('pclass = levels(pclass)', 'age = seq(0,100,20)')
Number of decimals to show
further arguments passed to or from other methods
See https://radiant-rstats.github.io/docs/model/nn.html for an example in Radiant
nn
to generate the result
summary.nn
to summarize results
# NOT RUN {
result <- nn(titanic, "survived", c("pclass", "sex"), lev = "Yes")
predict(result, pred_cmd = "pclass = levels(pclass)")
result <- nn(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