hierarchical-estimates-visu.../packages/webpage-refactor/README.md

106 lines
4.0 KiB
Markdown
Raw Normal View History

2022-06-17 17:44:08 +00:00
## About
2022-06-19 21:04:29 +00:00
This repository creates a react webpage that allows to extract a utility function from possibly inconsistent binary comparisons.
It presents the users with a series of elements to compare, using merge-sort in the background to cleverly minimize the number of choices needed.
2022-06-19 23:25:55 +00:00
![](./public/example-prompt.png)
Then, it cleverly aggregates them, on the one hand by producing a graphical representation:
![](./public/example-graph.png)
and on the other hand doing some fast and clever mean aggregation [^1]:
![](./public/example-table.png)
2022-06-17 17:44:08 +00:00
Initially, users could only input numbers, e.g., "A is `3` times better than B". But now, users can also input distributions, using the [squiggle](https://www.squiggle-language.com/) syntax, e.g., "A is `1 to 10` times better than B", or "A is `mm(normal(1, 10), uniform(0,100))` better than B".
2022-06-19 23:25:55 +00:00
**If you want to use the utility function extractor for a project, we are happy to add a page for your project, like `utility-function-extractor.quantifieduncertainty.org/your-project`**.
## Built with
- [Nextjs](https://nextjs.org/)
- [Netlify](https://github.com/netlify/netlify-plugin-nextjs/#readme)
- [React](https://reactjs.org/)
- [Squiggle](https://www.squiggle-language.com/)
- [Utility tools](to do: add links)
## Usage
2022-06-19 21:04:29 +00:00
2022-06-19 23:25:55 +00:00
Navigate to [utility-function-extractor.quantifieduncertainty.org/](https://utility-function-extractor.quantifieduncertainty.org/), and start comparing objects.
You can change the list of objects to be compared by clicking on "advanced options".
After comparing objects for a while, you will get a table and a graph with results. You can also use the [utility tools](to do: add link) package to process these results, for which you will need the json of comparisons, which can be found in "Advanced options" -> "Load comparisons"
## Notes
2022-06-17 17:44:08 +00:00
The core structure is json array of objects. Only the "name" attribute is required. If there is a "url", it is displayed nicely.
```
[
{
"name": "Peter Parker",
"someOptionalKey": "...",
"anotherMoreOptionalKey": "...",
},
{
"name": "Spiderman",
"someOptionalKey": "...",
"anotherMoreOptionalKey": "..."
}
]
```
2022-06-19 23:25:55 +00:00
The core structure for links is as follows:
```
[
{
"source": "Peter Parker",
"target": "Spiderman",
"squiggleString": "1 to 100",
"distance": 26.639800977355474
},
{
"source": "Spiderman",
"target": "Doctor Octopus",
"squiggleString": "20 to 2000",
"distance": 6.76997149080232
},
]
```
A previous version of this webpage had a more complicated structure, but it has since been simplified.
## Contributions and help
We welcome PR requests.
2022-06-17 17:44:08 +00:00
2022-06-19 23:25:55 +00:00
## License
Distributed under the MIT License. See LICENSE.txt for more information.
2022-06-17 17:44:08 +00:00
## To do
2022-06-18 03:22:54 +00:00
- [x] Extract merge, findPath and aggregatePath functionality into different repos
2022-06-18 18:18:15 +00:00
- [x] Send to mongo upon completion
2022-06-18 18:57:22 +00:00
- [x] Push to github
- [x] Push to netlify
2022-06-18 18:18:15 +00:00
- [x] Don't allow further comparisons after completion
2022-06-19 23:25:55 +00:00
- [x] Paths table
- [x] Add paths table
- [x] warn that the paths table is approximate.
2022-06-19 21:04:29 +00:00
- However, I really don't feel like re-adding this after having worked out the distribution rather than the mean aggregation
- However, I think it does make it more user to other users.
- [ ] Add functionality like names, etc.
- I also don't feel like doing this
2022-06-18 03:22:54 +00:00
- [ ] Look back at Amazon thing which has been running
2022-06-19 23:25:55 +00:00
- [x] Change README.
## Footnotes
[^1]: The program takes each element as a reference point in turn, and computing the possible distances from that reference point to all other points, and taking the geometric mean of these distances. This produces a number representing the value of each element, such that the ratios between elements represent the user's preferences: a utility function. However, this isn't perfect; the principled approach woud be to aggregate the distributions rather than their means. But this principled approach is much more slowly. For the principled approach, see the `utility-tools` repository.