1. Learn
  2. /
  3. Courses
  4. /
  5. Explainable AI in Python

Connected

Exercise

Feature impact on cluster quality

Explore how individual features impact the clustering performance of a KMeans model. The dataset X is used for customer segmentation based on three features: income, number of kids, and number of teens in the house.

The silhouette_score function and the column_names variable have been pre-loaded for you.

Instructions

100 XP
  • Derive the original silhouette score (original_score).
  • In the for loop, remove features one by one and save the result in X_reduced.
  • Compute the new silhouette score (new_score).
  • Compute the impact of the feature.