We will be using the add-on package discrim to access functions to perform discriminant analysis models with parsnip and the klaR
package to perform the QDA calculations. if you haven’t already got it installed run
install.packages(c("discrim", "klaR"))
Create a test-train rsplit
object of mlc_churn
using initial_split()
. Use the arguments to set the proportions of the training data to be 80%. Stratify the sampling according to the churn
variable.
Do the following tasks for LDA, QDA and KNN model.
number_vmail_messages
, total_intl_minutes
, total_intl_calls
, total_intl_charge
, number_customer_service_calls
as predictors. Remember to fit the model only using the training data set.summary()
and tidy()
. How good are the variables we have chosen?conf_mat()
to construct a confusion matrix. Does the confusion matrix look good?