เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

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.

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Introduction to Anomaly Detection in R

ดูคอร์ส

คำแนะนำการฝึกหัด

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

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# Check the class of age column
___

# Check the class of sex column
___

# Fit an isolation forest with 100 trees
thyroid_for <- ___
แก้ไขและรันโค้ด