# Interactive Graph Stream Analytics in Arkouda
## 5 Single Pass Regression Analysis Stream Model
### Real-World Graph Distribution Based Regression Model
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Graph Name** & **Shrinking Factor** & **Head** & **Mid** & **Tail** & **Exact** \\ \[PERSON]\_n17 & 32 & 1042 & 2288 & 2347 & 263,616 \\ \hline delaunay\_n17 & 64 & 534 & 1156 & 1180 & 263,615 \\ \hline delaunay\_n18 & 4 & 16,904 & 37,774 & 38,061 & 527,234 \\ \hline delaunay\_n18 & 8 & 8155 & 19,005 & 19,107 & 527,233 \\ \hline delaunay\_n18 & 16 & 4176 & 9454 & 9562 & 527,231 \\ \hline delaunay\_n18 & 32 & 2097 & 4674 & 4686 & 527,230 \\ \hline delaunay\_n18 & 64 & 1004 & 2369 & 2348 & 527,229 \\ \hline amazon & 4 & 4944 & 6383 & 18,381 & 667,259 \\ \hline amazon & 8 & 1427 & 1752 & 7351 & 667,258 \\ \hline amazon & 16 & 621 & 617 & 3614 & 667,256 \\ \hline amazon & 32 & 331 & 290 & 2250 & 667,255 \\ \hline amazon & 64 & 177 & 153 & 1546 & 667,254 \\ \hline dblp & 4 & 20,269 & 41,390 & 168,996 & 2,225,882 \\ \hline dblp & 8 & 6876 & 17,043 & 67,782 & 2,225,881 \\ \hline dblp & 16 & 2684 & 4846 & 20,310 & 2,225,879 \\ \hline dblp & 32 & 1097 & 2726 & 11,456 & 2,225,878 \\ \hline dblp & 64 & 545 & 2325 & 2678 & 2,225,877 \\ \hline ca-HepTh.txt & 4 & 1267 & 1072 & 3853 & 28,677 \\ \hline ca-HepTh.txt & 8 & 642 & 591 & 1741 & 28,676 \\ \hline ca-HepTh.txt & 16 & 456 & 390 & 480 & 28,674 \\ \hline ca-HepTh.txt & 32 & 391 & 267 & 219 & 28,673 \\ \hline ca-HepTh.txt & 64 & 260 & 217 & 157 & 28,672 \\ \hline ca-CondMat.txt & 4 & 7960 & 10,280 & 12,051 & 174,578 \\ \hline ca-CondMat.txt & 8 & 4264 & 4970 & 5543 & 174,577 \\ \hline ca-CondMat.txt & 16 & 2862 & 2847 & 2655 & 174,575 \\ \hline ca-CondMat.txt & 32 & 1888 & 1693 & 1403 & 174,574 \\ \hline ca-CondMat.txt & 64 & 1179 & 1292 & 845 & 174,573 \\ \hline ca-AstroPh.txt & 4 & 75,594 & 78,234 & 78,855 & 1,374,119 \\ \hline ca-AstroPh.txt & 8 & 41,331 & 47,387 & 40,395 & 1,374,118 \\ \hline ca-AstroPh.txt & 16 & 24,828 & 28,244 & 20,468 & 1,374,116 \\ \hline ca-AstroPh.txt & 32 & 14,984 & 16,692 & 11,128 & 1,374,115 \\ \hline ca-AstroPh.txt & 64 & 6450 & 6507 & 6322 & 1,374,114 \\ \hline email-Enron.txt & 4 & 70,077 & 28,783 & 25,933 & 727,044 \\ \hline email-Enron.txt & 8 & 22,331 & 13,593 & 15,197 & 727,043 \\ \hline email-Enron.txt & 16 & 11,640 & 8381 & 5002 & 727,041 \\ \hline email-Enron.txt & 32 & 6681 & 5212 & 2392 & 727,040 \\ \hline email-Enron.txt & 64 & 3561 & 2912 & 1056 & 727,039 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: _Cont._For power law graphs, the sampling results of \(E_{H},E_{M},E_{T}\) can be significantly different because of the skewness in degree distribution. A power law distribution has the property that its log-log plot is a straight line. So we assume the logarithmic value of the total number of triangles in a stream graph should have a linear relationship with the logarithmic values of the exact number of triangles in different degree sub-sketches. Then we have two ways to build the regression model. One is unordered and the other is ordered. The unordered model can be expressed as in Equation (2). In this model, the relative order information of sampling results cannot be captured. \[TC_{powerlaw,log}=a\times E_{H,log}+b\times E_{M,log}+c\times E_{T,log}, \tag{2}\]  
where \(TC_{powerlaw,log}=log(TC_{powerlaw})\) is the logarithmic value of the estimated value \(TC_{powerlaw}\); \(E_{H,log}=log(E_{H})\), \(E_{M,log}=log(E_{M})\), and \(E_{T,log}=log(E_{T})\); \(log(E_{H})\), \(log(E_{M})\), and \(log(E_{T})\) are the logarithmic values of \(E_{H},E_{M}\), and \(E_{T}\), respectively. Then, we refine the regression model for power law distribution as follows. We get \(E_{min},E_{median}\) and \(E_{max}\) by sorting \(E_{H},E_{M}\), and \(E_{T}\). They mean the minimum, median and maximum sampling values of the number of triangles. They will be used to stand for the sampling results of a power law distribution at the right (low possibility), middle (a little bit high possibility) and left part (very high possibility). We let \(E_{min,log}=log(E_{min})\), \(E_{median,log}=log(E_{median})\), and \(E_{max,log}=log(E_{max})\).