1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Anomaly Detection in R

Connected

Exercise

Isolation forest with factors

As you saw in the video, an isolation forest can accept categorical features as input, but only if they are encoded as factor variables.

In this exercise, the thyroid data you edited in the previous exercise is preloaded. To be extra careful, you should first check that all of the features are numeric or factor before attempting to train an isolation forest.

Instructions

100 XP
  • Check that the age and sex columns in the thyroid data are encoded as factors.
  • Then train an isolation forest with 100 trees.