การทบทวนและเปรียบเทียบโมเดล

การพยากรณ์ CTR ด้วย Machine Learning ใน Python

Kevin Huo

Instructor

ทบทวนโมเดล

from sklearn.linear_model import LogisticRegression
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.neural_network import MLPClassifier
  • Logistic regression: ตัวแยกประเภทเชิงเส้นที่ระบุขอบเขตการตัดสินใจ
  • Decision trees: เงื่อนไขในรูปแบบต้นไม้
  • Random Forests: กลุ่มของ Decision Trees
  • Neural Networks (MLPs): เลเยอร์ที่ใช้การรวมเชิงเส้นของฟีเจอร์ร่วมกับฟังก์ชัน activation แบบนอนลิเนียร์
การพยากรณ์ CTR ด้วย Machine Learning ใน Python

การนำโมเดลไปใช้

ความเหมือน
  • การแปลงฟีเจอร์และ regularization
  • ฝึกโมเดลด้วย classifier.fit(X_train, y_train)
  • พยากรณ์ด้วย predict_proba() และ predict()
ความต่าง
  • Decision Trees: max_depth, min_samples_split
  • Random Forests: n_estimators, oob_score
  • Logistic Regression: fit_intercept, class_weight
  • Neural Networks: hidden_layer_sizes, max_iter
การพยากรณ์ CTR ด้วย Machine Learning ใน Python

การประเมินโมเดล

  • เมตริกประเมินผลหลัก:
    • Confusion matrix: confusion_matrix(y_test, y_pred)
    • Precision: precision_score(y_test, y_pred)
    • Recall: recall_score(y_test, y_pred)
    • F-beta score: fbeta_score(y_test, y_pred, beta = 0.5)
    • AUC of ROC curve: roc_auc_score(y_test, y_score[:, 1])
การพยากรณ์ CTR ด้วย Machine Learning ใน Python

ข้อดีและข้อเสียหลักของ neural networks

ข้อดี

  • ปรับขนาดได้ตามข้อมูล
  • ต้องการ feature engineering น้อยกว่า
  • ถ่ายโอนข้ามโดเมนได้ดีกว่า

ข้อเสีย

  • ประสิทธิภาพต่ำกว่าเมื่อข้อมูลน้อย
  • ตีความผลได้ยาก
  • ใช้ทรัพยากรการคำนวณและต้นทุนสูงกว่า
การพยากรณ์ CTR ด้วย Machine Learning ใน Python

มาฝึกกันเถอะ!

การพยากรณ์ CTR ด้วย Machine Learning ใน Python

Preparing Video For Download...