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

Confusion matrices

You have just finished creating a classification model. This model predicts whether tweets were created by a left-leaning (democrat) or right-leaning (republican) tweet bot. You have made predictions on the test data and have the following result:

Predictions Left Right
Left 350 157
Right 57 436

Use the confusion matrix above to answer questions about the models accuracy.

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

Introduction to Natural Language Processing in R

ดูคอร์ส

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

  • What percentage of tweets did you successfully label as Left?
  • What percentage of tweets did you successfully label as Right?
  • What percentage of tweets did you successfully label?

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

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

# Percentage correctly labeled "Left"
left <- (___) / (350 + 157)
left

# Percentage correctly labeled "Right"
right <- (___) / (___ + ___)
right

# Overall Accuracy:
accuracy <- (___ + ___) / (___ + ___ + ___ + ___)
accuracy
แก้ไขและรันโค้ด