Ravindra BagaleCourses & study guides English Track your progress

39. सुरुवात ते शेवट Machine Learning Project (India Dataset)

Data Science

39.4 Evaluate आणि Choose

का गरजेचे आहे. Metrics + त्वरित overfit sanity check ने निवडा, मग निकाल business शब्दांत सांगा.

हे काय आहे. Test set वर precision/recall (आणि accuracy) तुलना करा; silly memorisation साठी train accuracy सुद्धा पाहा.

कसे करायचे.

Evaluate आणि निर्णय

  1. Test वर दोन्ही models साठी classification_report print करा.
  2. Forest साठी train vs test accuracy print करा.
  3. या toy कथेसाठी प्राथमिक model निवडा आणि कारण सांगा.
  4. पुढील एक सुधारणा लिहा (जास्त rows, city feature encoded, चांगला threshold).
from sklearn.metrics import classification_report, accuracy_score, confusion_matrix

for name, model, pred in [
 ("logistic", log_reg, pred_lr),
 ("forest", forest, pred_rf),
]:
 print("====", name, "TEST ====")
 print(classification_report(y_test, pred, zero_division=0))
 print("confusion:\n", confusion_matrix(y_test, pred))

print("forest train acc", accuracy_score(y_train, forest.predict(X_train)))
print("forest test acc", accuracy_score(y_test, forest.predict(X_test)))

तुम्हाला काय दिसायला हवे. या tiny sample वर एका model ला अनुकूल reports. 20 rows वर विजेत्याला शिकवण्याची निवड समजा — खऱ्या Mauli data ला जास्त shops आणि time-aware split लागेल.

Ravindra Bagale's Tip

Do not pick a winning model based on a very small dataset. What you learned here is the right process, so use the same steps later on bigger, real data.