- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
Weka[28] EM 源代码分析
作者:Koala++/屈伟
EM 算法在 clusterers 下面,提一下是因为我没有想到它竟然在这里,而且它的名字也
太大了点,因为这里它只是与 SimpleKMeans 结合的算法。
引自 Andrew Ng 的 Lecture notes mixtures of Gaussians and the EM algorithm:The
EM-algorithm is also reminiscent of the K-means clustering algorithm, except that instead of
“hard” cluster assignment c(i), we instead have the “soft” assignment w_j^(i). Similar to K-means,
it is also susceptible to local optima, so reinitializing at several different initial parameters may be
a good idea。
Soft 指的是我们猜测是概率,取值在[0,1]区间,相反,“hard”猜测是指单个最好的猜测,
可以取值在 {0,1}或是 {1,…,k}。英文原文: The term “soft” refers to our guesses being
probabilities and taking values in [0,1]; in contrast, a “hard” guess is one that represents a single
best guess( such as taking values in {0,1} or {1,…,k})
下面的图来自 Ng Andrew 和 Bishop Chistopher,第一组图 K-Means 的猜测是两个点,
而第二组图 EM 是对概率的猜测。
另一点是刚才文中提到的,多个初始化点,在代码中也体现了。
Ng 在对 EM 算法收敛证明之后,解释如下:Hence, EM causes the likelihood to converge
monotonically. In our description of the EM algorithm, we said wed run it until convergence.
Given the result that we just showed, one reasonable convergence test would be to check if the
increase in l(theta) between successive iterations is smaller than some tolerance parameter, and to
declare convergence if EM is improving l(theta) too slowly.
从 buildCluster 开始:
if (data.checkForStringAttributes()) {
throw new Exception(Cant handle string attributes!);
}
m_replaceMissing = new ReplaceMissingValues();
Instances instances = new Instances(data);
instances.setClassIndex(-1);
m_replaceMissing.setInputFormat(instances);
data = weka.filters.Filter.useFilter(instances, m_replaceMissing);
instances = null;
m_theInstances = data;
// calculate min and max values for attributes
m_minValues = new double[m_theInstances.numAttributes()];
m_maxValues = new double[m_theInstances.numAttributes()];
for (int i = 0; i m_theInstances.numAttributes(); i++) {
m_minValues[i] = m_maxValues[i] = Double.
您可能关注的文档
最近下载
- 人教部编版语文小学四年级阅读理解:概括中心(课件).pptx VIP
- 5.1.3数据的直观表示教学设计-2024-2025学年高一上学期数学人教B版(2019)必修第二册.docx VIP
- 2025年秋新冀少版生物7年级上册全册教学课件(新版教材).pptx
- 高速公路路基沉降变形观测实施方案.docx VIP
- 莫言文学课程设计.docx VIP
- 风力发电场电气设计-修改后.ppt VIP
- (正式版)H-Y-T 0288-2020 宗海价格评估方法(报批标准名称:海域价格评估技术规范)(正式版).docx VIP
- 植入式无线供电神经信号采集与刺激系统研发_毕业论文.pdf VIP
- 数据结构(Python版)李冬梅课后习题答案.docx VIP
- 2025版苏教版数学二年级上册全册教学设计教案.pdf
文档评论(0)