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 merupakan bagian dari kursus
Explainable AI in Python
Instruksi latihan
- Derive the
shap_valuesusing aTreeExplainer. - Use the derived
shap_valuesto plot the beeswarm plot and analyze it.
Latihan interaktif langsung praktik
Cobalah latihan ini dengan melengkapi kode contoh ini.
model = RandomForestRegressor(random_state=42)
model.fit(X_train, y_train)
# Derive shap values
explainer = ____
shap_values = ____
# Plot the beeswarm plot
____