fixes
This commit is contained in:
parent
4385494a38
commit
1f7ed5116e
1 changed files with 8 additions and 2 deletions
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue