From 1f7ed5116efc6c90cd99b910301e9af8092f93cf Mon Sep 17 00:00:00 2001 From: biglyderv Date: Tue, 28 Jan 2025 18:53:38 -0500 Subject: [PATCH] fixes --- docs/stats.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/stats.php b/docs/stats.php index 722eb0e..58345d4 100755 --- a/docs/stats.php +++ b/docs/stats.php @@ -36,11 +36,16 @@ $matrixe[$fn][$fn] = 1; } + $ch = 0; foreach ($result as $usern) { $theuser = $usern['username']; $followers = $frs[$theuser]; - + + if (count($followers) > 0) { + $ch++; + } + foreach ($followers as $follown) { $fn = $follown['target']; @@ -60,6 +65,7 @@ $matrixf = $matrixe; $msum_old = $msum; $msum = 1; + foreach ($result as $usera) { $una = $usera['username']; $pr[$una] = 0.1; @@ -69,7 +75,7 @@ $matrixe[$una][$unb] = 0; foreach ($result as $userc) { $unc = $userc['username']; - $matrixe[$una][$unb] += 0.3 + $matrixf[$una][$unc] * $matrixf[$unc][$unb] / $msum_old * pow(count($result),3); + $matrixe[$una][$unb] += 0.1 + $matrixf[$una][$unc] * $matrixf[$unc][$unb] / $msum_old * pow($ch,3); } $msum += $matrixe[$una][$unb]; $pr[$una] += $prold[$unb] * $matrixe[$una][$unb];