From 8906eae584cfc59b3c25c279fe23864eb8eef521 Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Tue, 2 Feb 2021 19:01:34 +0100 Subject: [PATCH] Added various good judment (Superforecaster) dashboards --- README.md | 2 +- data/goodjudgment-questions.csv | 15 +++++ data/goodjudgment-questions.json | 100 +++++++++++++++++++++++++++++++ data/merged-questions.csv | 14 +++++ data/merged-questions.json | 98 ++++++++++++++++++++++++++++++ src/goodjudgment-fetch.js | 42 +++++++++++++ src/index.js | 41 +++++++------ 7 files changed, 293 insertions(+), 19 deletions(-) create mode 100644 data/goodjudgment-questions.csv create mode 100644 data/goodjudgment-questions.json create mode 100644 src/goodjudgment-fetch.js diff --git a/README.md b/README.md index 6146b63..392acc0 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,6 @@ From the top level directory, enter: `npm run start` ## Various notes - Right now, I'm fetching only a couple of common properties, such as the title, url, platform, whether a question is binary (yes/no), its percentage, and the number of forecasts. However, the code contains more fields commented out, such as trade volume, liquidity, etc. -- A note as to quality: Tentatively, Good Judgment Open ~ Metaculus > CSET > PredictIt ~> Polymarket >> Elicit > Omen. Further, prediction markets rarely go above 95% or below 5%. I'm not really sure where Hypermind falls in that spectrum. +- A note as to quality: Tentatively, Good Judgment >> Good Judgment Open ~ Metaculus > CSET > PredictIt ~> Polymarket >> Elicit > Omen. Further, prediction markets rarely go above 95% or below 5%. I'm not really sure where Hypermind falls in that spectrum. - For elicit and metaculus, this library currently filters questions with <10 predictions. - Omen *does* have very few active predictions at the moment; this is not a mistake. diff --git a/data/goodjudgment-questions.csv b/data/goodjudgment-questions.csv new file mode 100644 index 0000000..3b65a70 --- /dev/null +++ b/data/goodjudgment-questions.csv @@ -0,0 +1,15 @@ +"Title","URL","Platform","Binary question?","Percentage","# Forecasts" +"When will Joe Biden cease to be president of the United States?","https://goodjudgment.io/superforecasts/","Good Judgment",false,"none", +"Before 1 January 2023, will legislation raising the top marginal tax rate for long-term capital gains in the U.S. to higher than 20% become law?","https://goodjudgment.io/superforecasts/","Good Judgment",false,"none", +"Before 1 January 2023, will legislation raising the top corporate tax rate in the U.S. to higher than 21% become law?","https://goodjudgment.io/superforecasts/","Good Judgment",false,"none", +"Before 1 January 2023, will legislation creating a ""public option"" health insurance plan administered by the federal government become law?","https://goodjudgment.io/superforecasts/","Good Judgment",false,"none", +"Before 1 January 2023, will the United States ratify the TPP and/or the CPTPP?","https://goodjudgment.io/superforecasts/","Good Judgment",false,"none", +"What will be the U.S. real GDP for the second quarter of 2021 relative to the U.S. real GDP for the second quarter of 2019?","https://goodjudgment.io/superforecasts/","Good Judgment",false,"none", +"When will enough doses of FDA-approved COVID-19 vaccine(s) to inoculate 100 million people be distributed in the United States?","https://goodjudgment.io/superforecasts/","Good Judgment",false,"none", +"When will Germany report that 75 million cumulative vaccine doses for COVID-19 have been given?","https://goodjudgment.io/superforecasts/","Good Judgment",false,"none", +"When will the UK report that 35 million people in the UK have been vaccinated for COVID-19?","https://goodjudgment.io/superforecasts/","Good Judgment",false,"none", +"In 2021, what percentage of corporate board seats at S&P 500 firms will be held by racial minorities, according to The Conference Board?","https://goodjudgment.io/economist/","Good Judgment",false,"none", +"What will be the world's GDP in 2021 relative to the world's GDP in 2019, according to the IMF?","https://goodjudgment.io/economist/","Good Judgment",false,"none", +"What will be the value of sustainable funds' estimated annual flows in the U.S. in 2021 relative to 2020, according to Morningstar?","https://goodjudgment.io/economist/","Good Judgment",false,"none", +"When will enough doses of FDA-approved COVID-19 vaccine(s) to inoculate 200 million people be distributed in the United States?","https://goodjudgment.io/economist/","Good Judgment",false,"none", +"As of 1 July 2021, what will be the United Kingdom's Office for National Statistics (ONS) latest report of the percentage of working adults who 'worked from home exclusively'?","https://goodjudgment.io/economist/","Good Judgment",false,"none", \ No newline at end of file diff --git a/data/goodjudgment-questions.json b/data/goodjudgment-questions.json new file mode 100644 index 0000000..ab199d3 --- /dev/null +++ b/data/goodjudgment-questions.json @@ -0,0 +1,100 @@ +[ + { + "Title": "When will Joe Biden cease to be president of the United States?", + "URL": "https://goodjudgment.io/superforecasts/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "Before 1 January 2023, will legislation raising the top marginal tax rate for long-term capital gains in the U.S. to higher than 20% become law?", + "URL": "https://goodjudgment.io/superforecasts/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "Before 1 January 2023, will legislation raising the top corporate tax rate in the U.S. to higher than 21% become law?", + "URL": "https://goodjudgment.io/superforecasts/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "Before 1 January 2023, will legislation creating a \"public option\" health insurance plan administered by the federal government become law?", + "URL": "https://goodjudgment.io/superforecasts/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "Before 1 January 2023, will the United States ratify the TPP and/or the CPTPP?", + "URL": "https://goodjudgment.io/superforecasts/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "What will be the U.S. real GDP for the second quarter of 2021 relative to the U.S. real GDP for the second quarter of 2019?", + "URL": "https://goodjudgment.io/superforecasts/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "When will enough doses of FDA-approved COVID-19 vaccine(s) to inoculate 100 million people be distributed in the United States?", + "URL": "https://goodjudgment.io/superforecasts/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "When will Germany report that 75 million cumulative vaccine doses for COVID-19 have been given?", + "URL": "https://goodjudgment.io/superforecasts/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "When will the UK report that 35 million people in the UK have been vaccinated for COVID-19?", + "URL": "https://goodjudgment.io/superforecasts/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "In 2021, what percentage of corporate board seats at S&P 500 firms will be held by racial minorities, according to The Conference Board?", + "URL": "https://goodjudgment.io/economist/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "What will be the world's GDP in 2021 relative to the world's GDP in 2019, according to the IMF?", + "URL": "https://goodjudgment.io/economist/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "What will be the value of sustainable funds' estimated annual flows in the U.S. in 2021 relative to 2020, according to Morningstar?", + "URL": "https://goodjudgment.io/economist/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "When will enough doses of FDA-approved COVID-19 vaccine(s) to inoculate 200 million people be distributed in the United States?", + "URL": "https://goodjudgment.io/economist/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "As of 1 July 2021, what will be the United Kingdom's Office for National Statistics (ONS) latest report of the percentage of working adults who 'worked from home exclusively'?", + "URL": "https://goodjudgment.io/economist/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + } +] \ No newline at end of file diff --git a/data/merged-questions.csv b/data/merged-questions.csv index 7b3843c..b4120ac 100644 --- a/data/merged-questions.csv +++ b/data/merged-questions.csv @@ -1551,6 +1551,20 @@ how much will 1 hour of subjective run time cost?","https://www.metaculus.com/qu "How much will the U.S. government spend on surveillance-related AI grants between June 1, 2020 and May 31, 2021, inclusive?","https://www.cset-foretell.com/questions/41-how-much-will-the-u-s-government-spend-on-surveillance-related-ai-grants-between-june-1-2020-and-may-31-2021-inclusive","CSET-foretell",false,"none","87" "How many times will the Japanese Air Force respond to threats to Japan's territorial airspace by Chinese military aircraft between April 1, 2020 and March 31, 2021, inclusive?","https://www.cset-foretell.com/questions/32-how-many-sorties-against-chinese-aircraft-will-the-japanese-air-self-defense-force-conduct-by-april-30th-2020","CSET-foretell",false,"none","90" "How many new H-1B visa applications submitted by the ""Big 5"" tech companies will the U.S. grant between October 1, 2020 and September 30, 2021, inclusive?","https://www.cset-foretell.com/questions/23-how-many-new-h-1b-applications-submitted-by-the-big-5-tech-companies-will-the-u-s-grant-in-fy-2020","CSET-foretell",false,"none","120" +"When will Joe Biden cease to be president of the United States?","https://goodjudgment.io/superforecasts/","Good Judgment",false,"none", +"Before 1 January 2023, will legislation raising the top marginal tax rate for long-term capital gains in the U.S. to higher than 20% become law?","https://goodjudgment.io/superforecasts/","Good Judgment",false,"none", +"Before 1 January 2023, will legislation raising the top corporate tax rate in the U.S. to higher than 21% become law?","https://goodjudgment.io/superforecasts/","Good Judgment",false,"none", +"Before 1 January 2023, will legislation creating a ""public option"" health insurance plan administered by the federal government become law?","https://goodjudgment.io/superforecasts/","Good Judgment",false,"none", +"Before 1 January 2023, will the United States ratify the TPP and/or the CPTPP?","https://goodjudgment.io/superforecasts/","Good Judgment",false,"none", +"What will be the U.S. real GDP for the second quarter of 2021 relative to the U.S. real GDP for the second quarter of 2019?","https://goodjudgment.io/superforecasts/","Good Judgment",false,"none", +"When will enough doses of FDA-approved COVID-19 vaccine(s) to inoculate 100 million people be distributed in the United States?","https://goodjudgment.io/superforecasts/","Good Judgment",false,"none", +"When will Germany report that 75 million cumulative vaccine doses for COVID-19 have been given?","https://goodjudgment.io/superforecasts/","Good Judgment",false,"none", +"When will the UK report that 35 million people in the UK have been vaccinated for COVID-19?","https://goodjudgment.io/superforecasts/","Good Judgment",false,"none", +"In 2021, what percentage of corporate board seats at S&P 500 firms will be held by racial minorities, according to The Conference Board?","https://goodjudgment.io/economist/","Good Judgment",false,"none", +"What will be the world's GDP in 2021 relative to the world's GDP in 2019, according to the IMF?","https://goodjudgment.io/economist/","Good Judgment",false,"none", +"What will be the value of sustainable funds' estimated annual flows in the U.S. in 2021 relative to 2020, according to Morningstar?","https://goodjudgment.io/economist/","Good Judgment",false,"none", +"When will enough doses of FDA-approved COVID-19 vaccine(s) to inoculate 200 million people be distributed in the United States?","https://goodjudgment.io/economist/","Good Judgment",false,"none", +"As of 1 July 2021, what will be the United Kingdom's Office for National Statistics (ONS) latest report of the percentage of working adults who 'worked from home exclusively'?","https://goodjudgment.io/economist/","Good Judgment",false,"none", "Will there be a new prime minister of Italy before 1 September 2021?","https://www.gjopen.com/questions/1919-will-there-be-a-new-prime-minister-of-italy-before-1-september-2021","Good Judgment Open",true,"21%","38" "Will the United States report more deaths attributed to COVID-19 as of 31 December 2021 than will the European Union?","https://www.gjopen.com/questions/1916-will-the-united-states-report-more-deaths-attributed-to-covid-19-as-of-31-december-2021-than-will-the-european-union","Good Judgment Open",true,"35%","62" "How many vacancies will arise on the U.S. Supreme Court in 2021?","https://www.gjopen.com/questions/1915-how-many-vacancies-will-arise-on-the-u-s-supreme-court-in-2021","Good Judgment Open",false,"none","71" diff --git a/data/merged-questions.json b/data/merged-questions.json index 0bd95f5..99e3783 100644 --- a/data/merged-questions.json +++ b/data/merged-questions.json @@ -12594,6 +12594,104 @@ "# Forecasts": "120", "# Forecasters": "75" }, + { + "Title": "When will Joe Biden cease to be president of the United States?", + "URL": "https://goodjudgment.io/superforecasts/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "Before 1 January 2023, will legislation raising the top marginal tax rate for long-term capital gains in the U.S. to higher than 20% become law?", + "URL": "https://goodjudgment.io/superforecasts/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "Before 1 January 2023, will legislation raising the top corporate tax rate in the U.S. to higher than 21% become law?", + "URL": "https://goodjudgment.io/superforecasts/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "Before 1 January 2023, will legislation creating a \"public option\" health insurance plan administered by the federal government become law?", + "URL": "https://goodjudgment.io/superforecasts/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "Before 1 January 2023, will the United States ratify the TPP and/or the CPTPP?", + "URL": "https://goodjudgment.io/superforecasts/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "What will be the U.S. real GDP for the second quarter of 2021 relative to the U.S. real GDP for the second quarter of 2019?", + "URL": "https://goodjudgment.io/superforecasts/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "When will enough doses of FDA-approved COVID-19 vaccine(s) to inoculate 100 million people be distributed in the United States?", + "URL": "https://goodjudgment.io/superforecasts/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "When will Germany report that 75 million cumulative vaccine doses for COVID-19 have been given?", + "URL": "https://goodjudgment.io/superforecasts/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "When will the UK report that 35 million people in the UK have been vaccinated for COVID-19?", + "URL": "https://goodjudgment.io/superforecasts/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "In 2021, what percentage of corporate board seats at S&P 500 firms will be held by racial minorities, according to The Conference Board?", + "URL": "https://goodjudgment.io/economist/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "What will be the world's GDP in 2021 relative to the world's GDP in 2019, according to the IMF?", + "URL": "https://goodjudgment.io/economist/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "What will be the value of sustainable funds' estimated annual flows in the U.S. in 2021 relative to 2020, according to Morningstar?", + "URL": "https://goodjudgment.io/economist/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "When will enough doses of FDA-approved COVID-19 vaccine(s) to inoculate 200 million people be distributed in the United States?", + "URL": "https://goodjudgment.io/economist/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, + { + "Title": "As of 1 July 2021, what will be the United Kingdom's Office for National Statistics (ONS) latest report of the percentage of working adults who 'worked from home exclusively'?", + "URL": "https://goodjudgment.io/economist/", + "Platform": "Good Judgment", + "Binary question?": false, + "Percentage": "none" + }, { "Title": "Will there be a new prime minister of Italy before 1 September 2021?", "URL": "https://www.gjopen.com/questions/1919-will-there-be-a-new-prime-minister-of-italy-before-1-september-2021", diff --git a/src/goodjudgment-fetch.js b/src/goodjudgment-fetch.js new file mode 100644 index 0000000..fdbb653 --- /dev/null +++ b/src/goodjudgment-fetch.js @@ -0,0 +1,42 @@ +/* Imports */ +import axios from "axios" +import fs from "fs" + +/* Definitions */ +let endpoints = ["https://goodjudgment.io/superforecasts/", "https://goodjudgment.io/economist/"] + +/* Support functions */ + +/* Body */ + +export async function goodjudgment(){ + let results = [] + for(let endpoint of endpoints){ + let content = await axios.get(endpoint) + .then(query => query.data) + let questions = content.split(` Today's
Forecast `) + for(let question of questions){ + let lastlineposition= question.lastIndexOf("value=") + let lastline = question.substring(lastlineposition+1, question.length) + if(!lastline.includes("Close Superforecaster Analysis") && !lastline.includes("\n")[1] + let lastlineremovetags2 = lastlineremovetags1.replace(" json2csvParser.parse(csv); -let sets = ["template", "elicit", "metaculus", "predictit", "polymarket", "csetforetell", "goodjudmentopen", "omen", "hypermind"] +let sets = ["template", "elicit", "metaculus", "predictit", "polymarket", "csetforetell", "goodjudgment","goodjudmentopen", "omen", "hypermind"] let suffix = "-questions" let locationData = "./data/" let sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); @@ -72,36 +73,39 @@ let executeoption = async (option) => { elicit() break; case 3: - goodjudgmentopen() + goodjudgment() break; case 4: - metaculus() + goodjudgmentopen() break; case 5: - polymarket() + hypermind() break; case 6: - predictit() + metaculus() break; case 7: omen() break; case 8: - hypermind() + polymarket() break; - case 9: - coverttocsvandmerge() + case 9: + predictit() break; case 10: + coverttocsvandmerge() + break; + case 11: await elicit() - //await sleep(30000) // The user only has 30secs. Not really ideal. await csetforetell() + await goodjudgment() await goodjudgmentopen() + await hypermind() await metaculus() + await omen() await polymarket() await predictit() - await omen() - await hypermind() await coverttocsvandmerge() break; default: @@ -114,13 +118,14 @@ let executeoption = async (option) => { let whattodoMessage = `What do you want to do? [1]: Download predictions from csetforetell [2]: Download predictions from elicit -[3]: Download predictions from goodjudgmentopen -[4]: Download predictions from metaculus -[5]: Download predictions from polymarket -[6]: Download predictions from predictit +[3]: Download predictions from goodjudgment +[4]: Download predictions from goodjudgmentopen +[5]: Download predictions from hypermind +[6]: Download predictions from metaculus [7]: Download predictions from omen -[8]: Download predictions from hypermind -[9]: Convert predictions to csvs and merge them into one big file (requires steps 1-8) -[10]: All of the above +[8]: Download predictions from polymarket +[9]: Download predictions from predictit +[10]: Convert predictions to csvs and merge them into one big file (requires previous steps) +[11]: All of the above Choose one option, wisely: #` whattodo(whattodoMessage, executeoption)