Skip to content

Commit 2cef388

Browse files
author
linyiqun
committed
维特比算法场景测试类
维特比算法场景测试类
1 parent 20302fd commit 2cef388

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

Others/DataMining_Viterbi/Client.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package DataMining_Viterbi;
2+
3+
/**
4+
* 维特比算法
5+
*
6+
* @author lyq
7+
*
8+
*/
9+
public class Client {
10+
public static void main(String[] args) {
11+
// 状态转移概率矩阵路径
12+
String stmFilePath;
13+
// 混淆矩阵路径
14+
String cfFilePath;
15+
// 观察到的状态
16+
String[] observeStates;
17+
// 初始状态
18+
double[] initStatePro;
19+
ViterbiTool tool;
20+
21+
stmFilePath = "C:\\Users\\lyq\\Desktop\\icon\\stmatrix.txt";
22+
cfFilePath = "C:\\Users\\lyq\\Desktop\\icon\\humidity-matrix.txt";
23+
24+
initStatePro = new double[] { 0.63, 0.17, 0.20 };
25+
observeStates = new String[] { "Dry", "Damp", "Soggy" };
26+
27+
tool = new ViterbiTool(stmFilePath, cfFilePath, initStatePro,
28+
observeStates);
29+
tool.calHMMObserve();
30+
}
31+
}

0 commit comments

Comments
 (0)