Skip to main content

Table 2 Algorithm 2 Random GO walk

From: Multi-label literature classification based on the Gene Ontology graph

1 inputs:
        d, a new document
        G, a GO graph with training cases
        nSample, the sample size
        nMaxSteps, the number of maximum steps
2 initialize:
3    finalLeaves ← {}
4    finalLeavesProbs ← {}
5 for n in 1: nSamples
6    g ← initialize()
7       //Select initial GO node randomly
     for s in 1: nMaxSteps:
8       T ← TempFunc(s)
9       nbrsG.neighbors(g)
10       g* ← q(g*|g, d)
           //Sample from proposal distribution, g*{g, nbrs}
11       u ← uniform [0, 1]
12       if u <A min ( 1 , p ( g | d ) 1 T q ( g | g , d ) p ( g | d ) 1 T q ( g | g , d ) ) MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfKttLearuWrP9MDH5MBPbIqV92AaeXatLxBI9gBaebbnrfifHhDYfgasaacPC6xNi=xH8viVGI8Gi=hEeeu0xXdbba9frFj0xb9qqpG0dXdb9aspeI8k8fiI+fsY=rqGqVepae9pg0db9vqaiVgFr0xfr=xfr=xc9adbaqaaeGaciGaaiaabeqaaeqabiWaaaGcbaGagiyBa0MaeiyAaKMaeiOBa42aaeWaaeaacqaIXaqmcqGGSaaljuaGdaWcaaqaaiabdchaWjabcIcaOiabdEgaNnaaCaaabeqaaiabgEHiQaaacqGG8baFcqWGKbazcqGGPaqkdaahaaqabeaadaWcdaqaaiabigdaXaqaaiabdsfaubaaaaGaemyCaeNaeiikaGIaem4zaCMaeiiFaWNaem4zaC2aaWbaaeqabaGaey4fIOcaaiabcYcaSiabdsgaKjabcMcaPaqaaiabdchaWjabcIcaOiabdEgaNjabcYha8jabdsgaKjabcMcaPmaaCaaabeqaamaalmaabaGaeGymaedabaGaemivaqfaaaaacqWGXbqCcqGGOaakcqWGNbWzdaahaaqabeaacqGHxiIkaaGaeiiFaWNaem4zaCMaeiilaWIaemizaqMaeiykaKcaaaGccaGLOaGaayzkaaaaaa@5D55@
13          gg*
14    end
15    finalLeaves ← union(finalLeaves, curNode)
16 end
17 finaLeavesProbs ← calProbFromSample(finalLeaves)
18 outputs: finalLeaves, finaLeavesProbs