Erklärbare KI in Python
Fouad Trad
Machine Learning Engineer




Einfache Modelle sind:
Komplexe Modelle sind:

Zeigen Entscheidungsweg anhand von Bedingungen

Zeigen Entscheidungsweg anhand von Bedingungen

Zeigen Entscheidungsweg anhand von Bedingungen

Nicht von Natur aus transparent

Zeigen Entscheidungsweg anhand von Bedingungen

Nicht von Natur aus transparent

| GRE-Score | TOEFL-Score | Uni-Rating | SOP | LOR | CGPA | Aufnahme |
|---|---|---|---|---|---|---|
| 337 | 118 | 4 | 4,5 | 4,5 | 9,65 | 1 |
| 316 | 104 | 3 | 3 | 3,5 | 8,00 | 1 |
| 314 | 103 | 2 | 2 | 3 | 8,21 | 0 |
from sklearn.tree import DecisionTreeClassifier model = DecisionTreeClassifier(max_depth=5)model.fit(X_train, y_train)y_pred = model.predict(y_test)acc = accuracy_score(y_test, y_pred) print(f"Accuracy of Decision Tree: {acc}")
Accuracy of Decision Tree: 0.82
from sklearn.neural_network import MLPClassifier model = MLPClassifier(hidden_layer_sizes=(1000,1000))model.fit(X_train, y_train)y_pred = model.predict(y_test)acc = accuracy_score(y_test, y_pred) print(f"Accuracy of Neural Network: {acc}")
Accuracy of Neural Network: 0.9
from sklearn.tree export_text rules = export_text(model, feature_names=list(X_train.columns))print(rules)
|--- CGPA <= 8.34 | |--- GRE Score <= 320.50 | | |--- class: 0| |--- GRE Score > 320.50 | | |--- class: 1|--- CGPA > 8.34 | |--- GRE Score <= 319.50 | | |--- class: 1 ...
Gilt für ein bestimmtes Modell

Gilt für ein bestimmtes Modell

Gilt für jedes Modell


Erklärbare KI in Python