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ırEgzersiz talimatları
- Derive the
shap_valuesusing aTreeExplainer. - Use the derived
shap_valuesto 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
____