#' Iris classification on trained xgboost model
#'
#' @export
predict_iris <- function(Sepal.Length = 0, Sepal.Width = 0, Petal.Length = 0, Petal.Width = 0) {
data_pred <- c(Sepal.Length, Sepal.Width, Petal.Length, Petal.Width)
data_pred <- matrix(data_pred, nrow = 1)
prob <- predict(object = model_iris, newdata = data_pred)
label = iris_levels[which.max(prob)]
return(list(label = label, prob = prob))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.