Assessing impact with partial dependence plots
Building on your previous contributions, your next task is to explore how 'CGPA' and 'University Rating' influence admissions decisions. Our earlier analysis showed that 'CGPA' is the most important predictor, while 'University Rating' is the least important one. Using a partial dependence plot, we can see how changes in these features affect the probability of admission, giving the admissions committee nuanced insights into their impact.
X_train and y_train have been pre-loaded for you.
Deze oefening maakt deel uit van de cursus
Explainable AI in Python
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
from sklearn.ensemble import RandomForestRegressor
import shap
model = RandomForestRegressor(random_state=42)
model.fit(X_train, y_train)
# Generate the partial dependence plot for CGPA
shap.partial_dependence_plot(____, ____, X_train)