1023198294 / EM-algorithm-with-MapReduce

MapReduce Implementation for one dimensional EM algorithm estimating the GMM parameters

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

用MapReduce进行一维EM算法

项目说明

本项目为云计算概论实验期末设计,

实现了使用MapReduce对输入文件(一维随机散点)进行EM算法估计高斯混合模型的参数

输入文件的格式详见EM_test/input/points.dat

0.9297343391699845
0.12820398122075338
0.8990764280928981
0.46039866272725405
0.926096087867913
0.6580114239150554
0.5443840853889141
0.43094877919991426
0.8736300047670117
0.7816824922709702
0.7767822322791558
0.42065357275299986
0.2302866133040744
0.8799831830200654
0.27573401583335466
0.42558067442217684
...
​```

输出格式为三行一维数组,分别代表着[prob][means][var]

数组长度为混合高斯分布的个数,如EM_test/output/part-r-00000中所示

1	0.30967 0.06775 0.06755 0.03864 0.37441 0.14198 
0.50473 0.48427 0.52096 0.29589 0.49975 0.52430 
-0.15228 0.09789 -0.60465 0.11148 -0.03378 -0.06444 

代码说明

具体原理详见报告 report.pdf

  • mole/Config.java

    • 自定义类,用于存储全局信息。
  • mole/Config.java

    • 自定义类,用于存储高斯混合分布的信息。
  • mole/MyEM.java

    • 主函数,用于执行MapReduce
  • mole/WritableStruct.java

    • 自定义Writable数据结构
    • 用于mapreduce中的value传递

执行

$ cd EM_test
$ rm -rf output
$ hadoop jar test.jar input output

About

MapReduce Implementation for one dimensional EM algorithm estimating the GMM parameters


Languages

Language:Java 100.0%