func (q *WalkKernel) Score(n lattice.Node, population []lattice.Node) float64 { sampleSize := 10 mean, _ := stats.Mean(stats.Sample(sampleSize, len(population)), func(i int) float64 { o := population[i] return n.(*digraph.EmbListNode).Pat.Metric(o.(*digraph.EmbListNode).Pat) }) return mean }
func (k Kernel) Mean(i int) float64 { mean, _ := stats.Mean(stats.Srange(len(k)), func(j int) float64 { return k[i][j] }) return mean }