More actions
Main article: Technical overview of the ratings system
Setting up the sandbox
A new Linux VM was created to better support new algorithm code development (custom_algo.py / algorithms.py) on the PeerVerity sandbox. Some setup details follow. Much of what is said here follows Lem’s documentation and advice.
- VMWare Workstation 17 Player on MS Windows 11 Pro
- Ubuntu Linux 22.04 64 bit configured with 12 GB RAM, 60 GB HD, 8 CPU (this was increased from 2 due to a problem installing Poetry, see below)
- Default setup of Ubuntu OS
- Using preinstalled system Python (3.10.6)
- Installed Pycharm Community Edition (presented by OS on startup with a bunch of other software – just click on Pycharm)
- Installed npm: (version 8.5.1) https://itslinuxfoss.com/install-npm-ubuntu-22-04/#google_vignette:
$ sudo apt install npm -y
- Installed poetry: (version 1.6.1), https://python-poetry.org/docs/
$ sudo snap install curl
$ curl -sSL https://install.python-poetry.org | python3 -
Added export PATH="/home/petermenegay/.local/bin:$PATH"
to /home/petermenegay/.profile.
$ source .profile
(to effectuate the new .profile changes)
- git is installed by default on system but we need to setup a key so it recognizes our gitlab repository:
$ ssh-keygen
Hit enter when prompted for things like file or passphrase (default file and empty passphrase). It will then generate a public/private key pair. The Public key is at /home/petermenegay/.ssh/id_rsa.pub
- Copy and paste contents of id_rsa.pub to our public key section of gitlab
Now, on Linux VM in home directory:
$ mkdir Peerverity
$ cd Peerverity
Follow Lem’s instructions
$ git clone git@gitlab.syncad.com:peerverity/sandbox.git
$ pushd sandbox/client
$ npm ci
$ popd
$ pushd sandbox/server
$ poetry install
This last step will hang if the default 2 CPU’s are used in the VM configuration. Per Lem’s suggestion, use the same number of CPU’s as the host computer (8) and it will work fine.
Place a working custom_algo.py
file in the data
folder and then do the following:
$ cd sandbox/server
$ ./run_server.sh 8108
NOTE: The instructions mention a run_server.py
which has been apparently been replaced by run_server.sh
One more thing. After pulling the latest code from the repository you have to rebuild the client. So, starting in the sandbox
directory:
$ git pull
$ cd client
$ npm ci
(in case a new library was added)
$ npm run build
Now the client will contain all the latest changes.
Also, after pulling, go to the server directory and do
$ poetry install
in case anything was added to Python.
Open web browser (Firefox) and goto 0.0.0.0:8108
. You should see a big circle with nothing in it and some instructions for how to use the sandbox.
Using the sandbox
The sandbox is in the midst of development and, as expected, can be a little tricky to use at first. With some guidance, however, the following tutorial was created to help establish the basic flow. Here we are creating two nodes, each with a 60% probability (60/40 distribution) and combining them via Bayes with 100% trust. We expect this combination to yield 69%.
- $ ./run_server.sh 8108
- Open browser and goto 0.0.0.0:8108
- If the constellation isn’t blank, start a new one by clicking in gray box in upper left corner and entering a name you haven’t used before, eg junk11.
- Right click inside big orange circle to establish a new node. Select it by left clicking on it so it turns yellow.
- Middle click somewhere else to establish a 2nd node and connect it to the first.
- Left click in empty space to unselect everything (go back to neutral).
- Left click on first node to select it.
- Middle click somewhere else to create a 3rd node and connect it to the first.
- Click on 2nd node to select it (turns yellow) and hit E to edit. A small blank graph area will pop up.
- Click on left edge of graph at around 60% and click again in middle at same 60% to produce a filled in area over the first half of the graph. Click in the middle again, now at 40% and then click on right edge at 40%. Should have a 60/40 graph. Right click on it so it “takes”.
- Make a similar graph for 3rd Node.
- Left click on first node to select it (turns yellow). Right click on Node 2 and hit T to edit the trust for this relationship to 1.0.
- Repeat for Node 3.
- Click on 1st node to select it.
- Hit C to run an inquiry. Two little red rectangles should flow out from Node 1 to Nodes 2 and 3 followed by two little green rectangles from Node’s 2 and 3 back to Node 1.
- Graph will appear in lower left.
- Right click in graph to scale it (so you can see it). It should look approximately like a 69/31 distribution.
Lem and I discussed some preliminary ideas for improving the user interface:
- When you hover over a node, and results are available, bring them up in the popup below the node.
- Label the axes of the graphs.
- Allow user to pin the graph to keep it in place.
- Anchor the help guide to the right or left side.
- Should be able to delete selected things with Delete key. Also a way to delete the whole tree and start over. Apparently this is done now by just entering a new constellation name (click in gray box in upper left corner)
- Should be able to type numbers to set the opinions. Drawing the graph precisely is hard.
- Allow for an arbitrary number of bins. Currently the number of bins is set to 100.