MulaiMulai sekarang secara gratis

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.

Latihan ini adalah bagian dari kursus

Explainable AI in Python

Lihat Kursus

Petunjuk latihan

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

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

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

# Derive shap values
explainer = ____
shap_values = ____

# Plot the beeswarm plot
____
Edit dan Jalankan Kode