1. Learn
  2. /
  3. Courses
  4. /
  5. Reinforcement Learning from Human Feedback (RLHF)

Connected

Exercise

K-means for feedback clustering

You have a dataset of feedback responses, and you've used a GPT model to calculate confidence scores for each response. To identify unusual or outlier feedback, you apply k-means clustering to the low-confidence responses.

The KMeans algorithm, reviews and confidences variables, and np library have been preloaded.

Instructions

100 XP
  • Initialize the k-means algorithm. Set the random_state to 42 for code reproducibility.
  • Calculate distances from cluster centers to identify outliers as the difference between data and the corresponding cluster centers.