การประเมิน Imputation ที่ไม่ดี
การประเมิน imputation จะง่ายขึ้นถ้าเรารู้จักตัวอย่างที่ไม่ดีก่อน มาดูวิธี imputation ที่มักให้ผลไม่ดี นั่นคือการแทนค่าด้วยค่าเฉลี่ย (mean imputation)
ในแบบฝึกหัดนี้ เราจะสำรวจวิธีการทำงานของ mean imputation โดยใช้ box plot กับชุดข้อมูล oceanbuoys
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
การจัดการข้อมูลที่หายไปใน R
คำแนะนำการฝึกหัด
สำหรับชุดข้อมูล oceanbuoys:
- แทนค่าที่หายไปด้วยค่าเฉลี่ยโดยใช้
impute_mean_all()และติดตาม imputation เหล่านี้ด้วยadd_label_shadow() - สำรวจค่าที่ถูก impute ของความชื้น (
humidity) โดยใช้ box plot - สำรวจค่าที่ถูก impute ของอุณหภูมิอากาศ (
air_temp_c) โดยใช้ box plot
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
# Impute the mean value and track the imputations
ocean_imp_mean <- bind_shadow(___) %>%
___() %>%
___()
# Explore the mean values in humidity in the imputed dataset
ggplot(___,
aes(x = ___, y = ___)) +
geom_boxplot()
# Explore the values in air temperature in the imputed dataset
ggplot(___,
aes(x = ___, y = ___)) +
geom_boxplot()