शुरू करेंमुफ़्त में शुरू करें

अपने एन्सेम्बल का मूल्यांकन

पिछले अभ्यास में, आपने अपना पहला voting classifier बनाया था. अब इसे evaluate करते हैं और अलग-अलग मॉडलों के प्रदर्शन से तुलना करते हैं.

इंडिविजुअल मॉडल्स (clf_knn, clf_dt, और clf_lr) और voting classifier (clf_vote) पहले से लोड और ट्रेन किए जा चुके हैं.

परफॉर्मेंस के लिए f1_score() का उपयोग करना याद रखें. इसके अलावा, आप टेस्ट सेट (X_test, y_test) पर classification_report() फंक्शन का उपयोग करके एक classification report बनाएँगे.

क्या आपका voting classifier, decision tree के 58% F1-score को हरा पाएगा?

यह अभ्यास पाठ्यक्रम का हिस्सा है

Python में Ensemble Methods

पाठ्यक्रम देखें

अभ्यास निर्देश

  • Voting classifier clf_vote का उपयोग करके टेस्ट सेट X_test के लेबल्स को predict करें.
  • Voting classifier का F1-Score निकालें.
  • y_test और pred_vote पास करके classification_report() की मदद से voting classifier का classification report निकालें.

इंटरैक्टिव व्यावहारिक अभ्यास

इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।

# Calculate the predictions using the voting classifier
pred_vote = ____

# Calculate the F1-Score of the voting classifier
score_vote = ____
print('F1-Score: {:.3f}'.format(score_vote))

# Calculate the classification report
report = ____
print(report)
कोड संपादित करें और चलाएँ