Skip to content

Instantly share code, notes, and snippets.

@LuxunHuang
Created June 7, 2016 21:17
Show Gist options
  • Save LuxunHuang/9ee18bd912705c33f932fe0e67f1bdb3 to your computer and use it in GitHub Desktop.
Save LuxunHuang/9ee18bd912705c33f932fe0e67f1bdb3 to your computer and use it in GitHub Desktop.
T = null
minVariant = MAX_INT
for (T* = 0; T* < 255; T*++)
{
計算平均值 // 公式(1)、(2)
計算變異量 // 公式(3)、(4)
計算群內變異量總和 // 公式(5)
if (群內變異量總和 < minVariance)
{
T = T*
minVariance = 群內變異量總和
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment