BaşlayınÜcretsiz Başlayın

Analyzing feature effects with beeswarm plots

Continuing your role as a data scientist at the university, you now shift focus to a more detailed analysis of individual feature effects on admissions outcomes. While identifying key factors influencing admissions decisions was crucial, delving deeper allows us to understand how variations in these factors specifically affect predictions. This additional insight will help answer questions like how changes in test scores or CGPA influence the likelihood of admission, providing a clearer picture for making informed decisions and policy recommendations.

The shap library and the training data (X_train, y_train) have been pre-loaded for you.

Bu egzersiz

Explainable AI in Python

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Derive the shap_values using a TreeExplainer.
  • Use the derived shap_values to plot the beeswarm plot and analyze it.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

model = RandomForestRegressor(random_state=42)
model.fit(X_train, y_train)

# Derive shap values
explainer = ____
shap_values = ____

# Plot the beeswarm plot
____
Kodu Düzenle ve Çalıştır