Exercises

  1. A study was conducted to test the effect of applied psychological therapy on reducing the negative effects of puberty. For this purpose, three groups of 5 subjects were selected. The first group received family therapy, the second group received individual therapy, and the third group received no help. After six months, levels of depression, anxiety, and social chaos were examined. The following results were obtained (the higher the value the higher the level of the trait): Group 1: (6, 8, 9), (4, 3, 3), (0, 2, 8), (4, 1, 6), (0, 8, 4); Group 2: (11, 9, 8), (11, 6, 6), (5, 7, 4), (8, 6, 5), (4, 9, 4); Group 3: (12, 11, 6), (8, 8, 5), (9, 6, 7), (8, 10, 8), (11, 4, 3). Construct a Naive Bayesian model (with normal distributions). What is the LOO CV error??

    Note: Use tuneGrid = data.frame(fL = 0, adjust = 1, usekernel = FALSE)

  2. The Sonar dataset from the mlbench package contains information about sonar signals. You need to solve the problem of recognizing the surface (Class) from which the sonar signal bounced. Estimate the classification error of the QDA method using the resubstitution and CV LOO methods. Make a confusion matrix.

  3. The Glass dataset from the mlbench package contains information about 214 observation containing examples of the chemical analysis of 7 different types of glass. Construct a KNN model for parameters k = 1:3. What is the resubstitution error and LOO CV error. Make a confusion matrix.

  4. The Vehicle dataset from the mlbench package contains 846 observations, 18 features, and 4 classes. We want to classify the vehicle silhouette. Construct a classification tree in which the variable Type depends on the rest of the variables. What is the resubstitution error and LOO CV error. Create a plot using the fancyRpartPlot() function from the rattle package.

  5. Load the dataset. The dataset is about heart disease in South Africa. Determine the resubstitution error and LOO CV for the LDA method.