Exemple #1
0
func main() {
	sumR := 0.0
	sum3 := 0.0
	sum5 := 0.0
	sum10 := 0.0

	for _, importer := range load.Ambiant {
		corpus := importer.Import()

		dpmom := cluster.NewDPMoM(corpus, 1, 20, .2, .2)
		graphical.RunCCM(dpmom, cluster.NewConvergenceCheck(dpmom.Z), 0)

		gold := importer.Label(corpus)
		pred := eval.NewClusteringState(dpmom.Z)
		cont := eval.NewContingency(gold, pred)
		rerank := eval.Rerank(dpmom.Z)

		sumR += cont.Rand()
		sum3 += eval.SRecallK(3, rerank, gold)
		sum5 += eval.SRecallK(5, rerank, gold)
		sum10 += eval.SRecallK(10, rerank, gold)
	}

	n := float64(len(load.Ambiant))
	fmt.Println("Rand :", sumR/n)
	fmt.Println("SR@3 :", sum3/n)
	fmt.Println("SR@5 :", sum5/n)
	fmt.Println("SR@10:", sum10/n)
}
Exemple #2
0
func MMCCM(c *pipeline.Corpus) []int {
	mom := MOM(c)
	graphical.RunCCM(mom, cluster.NewConvergenceCheck(mom.Z), 0)
	return mom.Z
}
Exemple #3
0
func DPCCM(c *pipeline.Corpus) []int {
	dpmom := DPMOM(c)
	graphical.RunCCM(dpmom, cluster.NewConvergenceCheck(dpmom.Z), 100)
	return dpmom.Z
}