Skip to main content
. Author manuscript; available in PMC: 2016 Jul 21.
Published in final edited form as: Proc IEEE Int Conf Data Min. 2015 Nov;2015:639–648. doi: 10.1109/ICDM.2015.39

Algorithm 1: Online Algorithm for SimNest

Input: Data matrix X = X1X2, Twitter data stream C, contact network G.
Output: the population’s predicted health states Ƶ.
1 Set the learning rate η = 0.5. Initialize weight matrix W as matrix of random values between -1 and 1;
2 repeat
3  Update unlabeled data set X2 by Twitter data stream;
4 repeat
5   Randomly select a labeled sample (Xu,t, Yu,t);
6    WWη1(Xu,t,Yu,t,W)W;
7   Randomly select an unlabeled sample Xu;
8    WWη3(Xu,pI,W)W;
9   Randomly select an unlabeled sample Xυ;
10   for i ← 1 to T do
11     WWη4(Xυ,i,Xυ,i+1,W)W
12   end
13   Randomly select a user u from a location lL;
14    WWη2(Xu,t,G,pE,pI,W)W;
15    μI1|U2|uU2tTfW(Xu,t);
16    σI(uU2tTfW(Xu,tμI)/|U2|)1/2;
17 until converge;
18 pE,ƵmintTlλ1υVlQυ,t(G,pE,pI)uU2,lfW(Xu,t)2;
19 λ1l,t,TuU2,lfW(Xu,t)/l,t,TυVsQυ,t(G,pE,pI)
20 until the end of data stream;