From the course: Machine Learning with Data Reduction in Excel, R, and Power BI

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Determining k

Determining k

- [Instructor] We can create an elbow chart visual like the one we see on the screen to determine the number of clusters we want to use in our KMeans algorithm. On the X axis, we see the number of clusters K and on the Y axis, we see the change in SSE or the standard square distance between each iteration of K clusters in the model. We can see there's a kink in the elbow chart where the rate of changing variants gets substantially lower. This is the ideal number of clusters we want to use in our model. In our studio, let's start by creating an elbow chart by first creating a new vector we'll call K and will assign the values from one to 20 within it. This new vector contains K values from one to 20 but notice we're not going up to 25 which is the limit of the number of clusters with 25 cities. We're not going up to 25 because that doesn't work in the algorithm. And we'll also see the kink occurs before then. Let's also…

Contents