Exercise

# K-means clustering

A very commonly used clustering algorithm is **K-means clustering**. For fraud detection, K-means clustering is straightforward to implement and relatively powerful in predicting suspicious cases. It is a good algorithm to start with when working on fraud detection problems. However, fraud data is oftentimes very large, especially when you are working with transaction data. **MiniBatch K-means** is an **efficient** way to implement K-means on a large dataset, which you will use in this exercise.

The scaled data from the previous exercise, `X_scaled`

is available. Let's give it a try.

Instructions

**100 XP**

- Import
`MiniBatchKMeans`

from`sklearn`

. - Initialize the minibatch kmeans model with 8 clusters.
- Fit the model to your scaled data.