Skip to content

Inertia in k-means clustering #594

Answered by vnmabus
frederik-f asked this question in Q&A
Discussion options

You must be logged in to vote

In your case you have the discretization grid $\mathbf{t} = (0, 1, 2, 3)$ and the functions $x_0, x_1, x_2$ with $x_0(\mathbf{t}) = (1, 2, 3, 4)$, $x_1(\mathbf{t}) = (6, 5, 4, 3)$ and $x_2(\mathbf{t}) = (5, 3, 1, -1)$.
The cluster centers are $c_0, c_1$ with $c_0(\mathbf{t}) = (5.5, 4, 2.5, 1)$ and $c_1(\mathbf{t}) = (1, 2, 3, 4)$.
The distance between two functions $f$ and $g$ is configurable using the metric parameter. By default is the $L^2$ distance, that is $d(f, g) = \sqrt{\int_{\mathcal{T}} |f(t)-g(t)|^2dt}$ (thus, analog to the Euclidean distance).
The distances appearing in the inertia are those between each observation and the cluster it belongs to (the closest one). Thus:
$d_0 …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@frederik-f
Comment options

Answer selected by frederik-f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants