Closed siebrenf closed 2 years ago
Code Climate has analyzed commit db979fd9 and detected 0 issues on this pull request.
The test coverage on the diff in this pull request is 100.0% (50% is the threshold).
This pull request will bring the total coverage in the repository to 58.2% (0.0% change).
View more on Code Climate.
I suck at git, so I continued this in #171. Closing.
In ANANSE influence we calculated the target scores, based on the interaction distance and the
weight
(the interaction probability from ANANSE network), using something like this:This monstrosity was required because we previously used a scoring function that takes the total path length as variable. This function guarantees we find the global maximum, but required this brute force approach AND limits the maximum interaction distance due to computational complexity.
In this PR
I applied a weight function that :
weight
The weight-function might not yield the exact same paths. However, I bench marked the functions with 100k edges (rounding the results to integers) and found no differences.
Why this matters
Benchmark results
targets
from the original weighted pathstargets
from the new weighted pathstargets
from the new weighted pathssame with 500k edges (column b was replaced with a faster check). Bonus stats: Column a took 18745 sec (98% of which were the 14.910.634 calls to
nx.all_simple_paths
). Columns c took 5 sec.