Permutation importance

Python में Explainable AI

Fouad Trad

Machine Learning Engineer

वाद्य की अहमियत जानने को सुरों को शफल करना

विभिन्न वाद्ययंत्र बजाते कलाकारों के बैंड की छवि.

Python में Explainable AI

Permutation importance

  • मॉडल-अज्ञेय तरीका
  • फीचर इम्पॉर्टेंस आँकता है
    • फीचर शफलिंग से प्रदर्शन पर असर मापता है
  • बेहद बहुउद्देशीय

न्यूरल नेटवर्क की संरचना: कई हिडन लेयर्स, हर एक में कई न्यूरॉन्स.

Python में Explainable AI

Permutation importance व्यवहार में

5 फीचर्स और एक प्रशिक्षित ML मॉडल वाले डेटासेट की छवि.

Python में Explainable AI

Permutation importance व्यवहार में

बेसलाइन परफॉर्मेंस पाने हेतु डेटासेट को ML मॉडल में देने की छवि.

Python में Explainable AI

Permutation importance व्यवहार में

एक फीचर को शफल करने की छवि: मूल मान [1, 2, 3, 4], शफल के बाद [4, 2, 1, 3]. शफल्ड डेटासेट से शफल्ड परफॉर्मेंस निकाला जाता है.

Python में Explainable AI

Permutation importance व्यवहार में

शफल किए गए फीचर की अहमियत प्रदर्शन में गिरावट के अनुपात में दिखाने वाली छवि.

Python में Explainable AI

Permutation importance व्यवहार में

बड़ी गिरावट उस फीचर की उच्च अहमियत दिखाती है, जबकि छोटी गिरावट कम अहमियत सुझाती है.

Python में Explainable AI

Admissions डेटासेट

GRE Score TOEFL Score University Rating SOP LOR CGPA Chance of Admit Accept
337 118 4 4.5 4.5 9.65 0.92 1
324 107 4 4 4.5 8.87 0.76 1
316 104 3 3 3.5 8 0.72 1
322 110 3 3.5 2.5 8.67 0.8 1
314 103 2 2 3 8.21 0.45 0

 

डेटा यहाँ है: X_train, y_train

Python में Explainable AI

MLPClassifier

from sklearn.neural_network import MLPClassifier
model = MLPClassifier(hidden_layer_sizes=(10,10))

model.fit(X_train, y_train)
Python में Explainable AI

Permutation importance

from sklearn.inspection import permutation_importance

result = permutation_importance(model,
X_train, y_train,
n_repeats=10,
random_state=42,
scoring='accuracy')
print(result.importances_mean)
[0.16213568 0.13831658 0.10575377 0.10522613 0.11741206 0.20072864]
Python में Explainable AI

अहमियत को विज़ुअलाइज़ करना

import matplotlib.pyplot as plt
plt.bar(X_train.columns,
        result.importances_mean)

Permutation importances का बार प्लॉट, जिसमें CGPA सबसे अधिक अहम दिखती है.

Python में Explainable AI

मॉडल-विशिष्ट तरीकों से तुलना

import matplotlib.pyplot as plt
plt.bar(X_train.columns, 
        result.importances_mean)

Permutation importances का बार प्लॉट, जिसमें CGPA सबसे अधिक अहम दिखती है.

Logistic regression
plt.bar(X_train.columns, np.abs(log_reg.coef_[0]))

Logistic regression कोएफिशिएंट्स का बार प्लॉट, जिसमें CGPA सबसे अधिक अहम दिखती है.

Python में Explainable AI

अभ्यास करते हैं!

Python में Explainable AI

Preparing Video For Download...