Update Notes on using Lem's algorithm interface authored by Peter Menegay's avatar Peter Menegay
...@@ -85,7 +85,7 @@ digraph G { ...@@ -85,7 +85,7 @@ digraph G {
} }
``` ```
Following the `straight_average_intermediate -- TEST1` in the snippet (XXX) we divide the calculation up into 3 sub-groups: 1,3,4 and 2,5,6 at the bottom level followed by 0,1,2 at the top level. Following the `straight_average_intermediate -- TEST1` in the snippet [custom_algo.py](https://gitlab.syncad.com/peerverity/trust-model-playground/-/snippets/147) we divide the calculation up into 3 sub-groups: 1,3,4 and 2,5,6 at the bottom level followed by 0,1,2 at the top level.
For sub-group 1,3,4 the opinion and components are defined according to the diagram, noting that Node 1 trusts itself fully (trust_factor = 1) and that `intermediate_results` is empty because we are at the bottom level. For sub-group 1,3,4 the opinion and components are defined according to the diagram, noting that Node 1 trusts itself fully (trust_factor = 1) and that `intermediate_results` is empty because we are at the bottom level.
...@@ -163,7 +163,7 @@ We don't need to do this since we're done but if Node 0 were to require transmis ...@@ -163,7 +163,7 @@ We don't need to do this since we're done but if Node 0 were to require transmis
comp0.intermediate_results = output012.intermediate_results comp0.intermediate_results = output012.intermediate_results
``` ```
Running the snippet XXX for this case gives an overall $P_{ave} = 0.616$, same as in [A-simple-averaging-technique-to-supplement-the-Bayes-equation](A-simple-averaging-technique-to-supplement-the-Bayes-equation). Running the snippet [custom_algo.py](https://gitlab.syncad.com/peerverity/trust-model-playground/-/snippets/147) for this case gives an overall $P_{ave} = 0.616$, same as in [A-simple-averaging-technique-to-supplement-the-Bayes-equation](A-simple-averaging-technique-to-supplement-the-Bayes-equation).
<h2>Trust-weighted histogram algorithm</h2> <h2>Trust-weighted histogram algorithm</h2>
...@@ -262,7 +262,7 @@ alginp1234 = AlgorithmInput([comp1, comp2, comp3, comp4], {'Nbins':10}) ...@@ -262,7 +262,7 @@ alginp1234 = AlgorithmInput([comp1, comp2, comp3, comp4], {'Nbins':10})
output1234 = trust_weighted_histogram(alginp1234) output1234 = trust_weighted_histogram(alginp1234)
``` ```
At this point we're done. Running the snippet XXX yields the expected result for Node 1's computed histogram: At this point we're done. Running the snippet [custom_algo.py](https://gitlab.syncad.com/peerverity/trust-model-playground/-/snippets/147) yields the expected result, same as in [trust_weighted_histogram algorithm](Dan's-proposal-for-trust-weighted-histograms), for Node 1's computed histogram:
[0.0, 0.0, 0.5555555555555556, 0.5, 1.0, 0.45, 0.9, 0.45, 0.45, 0.45] [0.0, 0.0, 0.5555555555555556, 0.5, 1.0, 0.45, 0.9, 0.45, 0.45, 0.45]
... ...
......