View source: R/predict_dummy_classifier.R
predict_dummy_classifier | R Documentation |
dummy classifier predictor
predict_dummy_classifier(object, X)
object |
a list created using dummy classifier. |
X |
a data frame. |
predicted values for the response variable.
# Split the data into training and testing sets
set.seed(2023)
index <- sample(1:nrow(iris), nrow(iris) * 0.8)
train_data <- iris[index,]
test_data <- iris[-index,]
dummy_model <- dummy_classifier(train_data$Species, strategy = "proportional", random_state = 2024)
# Make predictions using the trained dummy classifier
pred_vec <- predict_dummy_classifier(dummy_model, test_data)
# Evaluate the performance of the dummy classifier
conf_matrix <- caret::confusionMatrix(pred_vec, test_data$Species)
print(conf_matrix)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.