The K-means algorithm is based on the use of squared Euclidean distance as the measure of  dissimilarity between a data point and a prototype vector. Our goal is to partition the data set into some number K of clusters, where we shall suppose for the moment that the value of K is given. We can then define an objective function, sometimes called a distortion measure, given by J=ΣnΣkrnk||xnk||2,where n=1,...N, k=1,...,K, N is observations of a random D-dimensional Euclidean variable x, K is number of clusters. J represents the sum of the squares of the distances of each data point to its assigned vector μk. We can think of the μk as representing the centres of the clusters. Our goal is to find values for the {rnk} and the {μk} so as to minimize J. First we choose some initial values for the μk. Then in the first phase we minimize J with respect to the rnk, keeping the μk fixed. In the second phase we minimize J with respect to μk, keeping rnk fixed. This two-stage optimization is then repeated until convergence. We simply assign the nth data point to the closest cluster centre, this can be expressed as rnk=1,if k=argminj||xnj||2, otherwise rnk=0. The objective function J is a quadratic function of μk, and it can be minimized by setting its derivative with respect to μk to zero giving 2Σnrnk(xnk)=0. μk=(Σnrnkxn)/(Σnrnk), this result has a simple  interpretation, namely set μk equal to the mean of all of the data points xn assigned to cluster k. For this reason, the procedure is known as the K-means algorithm.

K-means algorithm----PRML读书笔记的更多相关文章

  1. expectation-maximization algorithm ---- PRML读书笔记

    An elegant and powerful method for finding maximum likelihood solutions for models with latent varia ...

  2. PRML读书笔记——2 Probability Distributions

    2.1. Binary Variables 1. Bernoulli distribution, p(x = 1|µ) = µ 2.Binomial distribution + 3.beta dis ...

  3. PRML读书笔记——机器学习导论

    什么是模式识别(Pattern Recognition)? 按照Bishop的定义,模式识别就是用机器学习的算法从数据中挖掘出有用的pattern. 人们很早就开始学习如何从大量的数据中发现隐藏在背后 ...

  4. PRML读书笔记——3 Linear Models for Regression

    Linear Basis Function Models 线性模型的一个关键属性是它是参数的一个线性函数,形式如下: w是参数,x可以是原始的数据,也可以是关于原始数据的一个函数值,这个函数就叫bas ...

  5. PRML读书笔记——Mathematical notation

    x, a vector, and all vectors are assumed to be column vectors. M, denote matrices. xT, a row vcetor, ...

  6. 【PRML读书笔记-Chapter1-Introduction】1.5 Decision Theory

    初体验: 概率论为我们提供了一个衡量和控制不确定性的统一的框架,也就是说计算出了一大堆的概率.那么,如何根据这些计算出的概率得到较好的结果,就是决策论要做的事情. 一个例子: 文中举了一个例子: 给定 ...

  7. PRML读书笔记——Introduction

    1.1. Example: Polynomial Curve Fitting 1. Movitate a number of concepts: (1) linear models: Function ...

  8. 【PRML读书笔记-Chapter1-Introduction】1.6 Information Theory

    熵 给定一个离散变量,我们观察它的每一个取值所包含的信息量的大小,因此,我们用来表示信息量的大小,概率分布为.当p(x)=1时,说明这个事件一定会发生,因此,它带给我的信息为0.(因为一定会发生,毫无 ...

  9. 【PRML读书笔记-Chapter1-Introduction】1.4 The Curse of Dimensionality

    维数灾难 给定如下分类问题: 其中x6和x7表示横轴和竖轴(即两个measurements),怎么分? 方法一(simple): 把整个图分成:16个格,当给定一个新的点的时候,就数他所在的格子中,哪 ...

  10. 【PRML读书笔记-Chapter1-Introduction】1.3 Model Selection

    在训练集上有个好的效果不见得在测试集中效果就好,因为可能存在过拟合(over-fitting)的问题. 如果训练集的数据质量很好,那我们只需对这些有效数据训练处一堆模型,或者对一个模型给定系列的参数值 ...

随机推荐

  1. html5——伸缩比例案例(携程)

    1.有图片的盒子,最好是父盒子设置伸缩属性,a标签设置伸缩比例1,img标签宽度100% 2.不要见到父盒子就设置伸缩属性,而是根据子盒子是否占据一行,若是子盒子占据一行,那么只要给子盒子设置伸缩比例 ...

  2. VC++文件监控 ReadDirectoryChangesW

    #include <windows.h> #include <tchar.h> #include <stdio.h> #include <assert.h&g ...

  3. nginx-配置反向代理实例

    nginx反向代理配置及优化 2009-05-26 作者:守住每一天blog:liuyu.blog.51cto.combbs:bbs.linuxtone.orgmsn:liuyubj520#hotma ...

  4. groupbox

    使用groupbox将radiobox 放入其中可以使组框中只选中一个

  5. BZOJ 3489: A simple rmq problem KDtree

    Code: #include<bits/stdc++.h> #define maxn 200000 #define inf 100000000 #define mid ((l+r)> ...

  6. c3p0 连接池配置

    C3P0 可使用properties 配置文件方式,将c3p0.properties放在classpath目录下,如果为WEB应用,放在WEB-INF\classes下 c3p0.properties ...

  7. MySQL之视图、触发器、存储过程、函数、事务、数据库锁

    一.视图 视图:是一个虚拟表,其内容由查询定义.同真实的表一样,视图包含一系列带有名称的列和行数据. 视图的特点: 1.视图的列可以来自不同的表,是表的抽象和逻辑意义上建立的新关系: 2.视图是由基本 ...

  8. windows桌面远程工具连接Ubuntu

    1.Ubuntu安装:sudo apt-get install xrdp    sudo apt-get install vnc4server sudo apt-get install xubuntu ...

  9. BZOJ 1230 Usaco2008 Nov 开关灯

    [题意概述] 给出一个01序列,初始时序列全为0,每次有修改操作或询问操作,修改操作要求把L~R区间中的0变成1,1变成0,查询操作要求输出L~R区间的1的个数 [题解] 线段树. 每次区间修改把区间 ...

  10. C#反射获取数据库字段

    static string sqlselect = "insert into {0}({1}) values ({2})"; (这个方法可以适用于任何数据库的插入语句) publi ...