chore: Cleanup.

- Deleted foretold community on astralcodexten questions
  - because now they are managed by Metaculus/Manifold
- fixed small mistake for good judgment
- recalculated scores for manifold markets
  - avoid low-quality markets.
This commit is contained in:
NunoSempere 2022-02-04 10:42:03 -05:00
parent 9159af7ece
commit a7c09e14ae
2 changed files with 304 additions and 262 deletions

View File

@ -1,23 +1,53 @@
import { mongoRead, upsert } from "./mongo-wrapper.js" import { mongoRead, upsert } from "./mongo-wrapper.js";
/* Merge everything */ /* Merge everything */
let sets = ["astralcodexten", "betfair", "coupcast", "csetforetell", "elicit", /* "estimize" ,*/ "fantasyscotus", "foretold", "givewellopenphil", "goodjudgment","goodjudmentopen", "hypermind", "kalshi", "ladbrokes", "manifoldmarkets", "metaculus", "omen", "polymarket", "predictit", "rootclaim", "smarkets", "wildeford", "williamhill", "xrisk"] // let sets = ["astralcodexten", "betfair", "coupcast", "csetforetell", "elicit", /* "estimize" ,*/ "fantasyscotus", "foretold", "givewellopenphil", "goodjudgment","goodjudmentopen", "hypermind", "kalshi", "ladbrokes", "manifoldmarkets", "metaculus", "omen", "polymarket", "predictit", "rootclaim", "smarkets", "wildeford", "williamhill", "xrisk"]
let suffix = "-questions" let sets = [
"betfair",
"coupcast",
"csetforetell",
"elicit",
/* "estimize" ,*/ "fantasyscotus",
"foretold",
"givewellopenphil",
"goodjudgment",
"goodjudmentopen",
"hypermind",
"kalshi",
"ladbrokes",
"manifoldmarkets",
"metaculus",
"omen",
"polymarket",
"predictit",
"rootclaim",
"smarkets",
"wildeford",
"williamhill",
"xrisk",
];
export async function mergeEverythingInner(){ let suffix = "-questions";
let merged = []
for(let set of sets){ export async function mergeEverythingInner() {
let json = await mongoRead(set+suffix) let merged = [];
console.log(`${set} has ${json.length} questions\n`) for (let set of sets) {
merged = merged.concat(json) let json = await mongoRead(set + suffix);
console.log(`${set} has ${json.length} questions\n`);
merged = merged.concat(json);
} }
let mergedprocessed = merged.map(element => ({...element, optionsstringforsearch: element.options.map(option => option.name).join(", ")})) let mergedprocessed = merged.map((element) => ({
console.log(`In total, there are ${mergedprocessed.length} questions`) ...element,
return mergedprocessed optionsstringforsearch: element.options
.map((option) => option.name)
.join(", "),
}));
console.log(`In total, there are ${mergedprocessed.length} questions`);
return mergedprocessed;
} }
export async function mergeEverything(){ export async function mergeEverything() {
let merged = await mergeEverythingInner() let merged = await mergeEverythingInner();
await upsert( merged,"metaforecasts") await upsert(merged, "metaforecasts");
console.log("Done") console.log("Done");
} }

View File

@ -1,321 +1,333 @@
export function getStarSymbols(numstars) { export function getStarSymbols(numstars) {
let stars = "★★☆☆☆" let stars = "★★☆☆☆";
switch (numstars) { switch (numstars) {
case 0: case 0:
stars = "☆☆☆☆☆" stars = "☆☆☆☆☆";
break; break;
case 1: case 1:
stars = "★☆☆☆☆" stars = "★☆☆☆☆";
break; break;
case 2: case 2:
stars = "★★☆☆☆" stars = "★★☆☆☆";
break; break;
case 3: case 3:
stars = "★★★☆☆" stars = "★★★☆☆";
break; break;
case 4: case 4:
stars = "★★★★☆" stars = "★★★★☆";
break; break;
case 5: case 5:
stars = "★★★★★" stars = "★★★★★";
break; break;
default: default:
stars = "★★☆☆☆" stars = "★★☆☆☆";
} }
return (stars) return stars;
} }
let average = array => array.reduce((a, b) => a + b, 0) / (array.length) let average = (array) => array.reduce((a, b) => a + b, 0) / array.length;
function calculateStarsAstralCodexTen(data) { function calculateStarsAstralCodexTen(data) {
let nuno = data => 3 let nuno = (data) => 3;
let eli = (data) => null let eli = (data) => null;
let misha = (data) => null let misha = (data) => null;
let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) let starsDecimal = average([nuno(data)]); //, eli(data), misha(data)])
let starsInteger = Math.round(starsDecimal) let starsInteger = Math.round(starsDecimal);
return starsInteger return starsInteger;
} }
function calculateStarsBetfair(data) { function calculateStarsBetfair(data) {
let nuno = data => data.volume > 10000 ? 4 : (data.volume > 1000 ? 3 : 2) let nuno = (data) => (data.volume > 10000 ? 4 : data.volume > 1000 ? 3 : 2);
let eli = (data) => data.volume > 10000 ? null : null let eli = (data) => (data.volume > 10000 ? null : null);
let misha = (data) => null let misha = (data) => null;
let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) let starsDecimal = average([nuno(data)]); //, eli(data), misha(data)])
// Substract 1 star if probability is above 90% or below 10% // Substract 1 star if probability is above 90% or below 10%
if(data.option && if (
data.option &&
(data.option.probability < 0.1 || data.option.probability > 0.9) (data.option.probability < 0.1 || data.option.probability > 0.9)
){ ) {
starsDecimal = starsDecimal - 1 starsDecimal = starsDecimal - 1;
} }
let starsInteger = Math.round(starsDecimal) let starsInteger = Math.round(starsDecimal);
return starsInteger return starsInteger;
} }
function calculateStarsCoupCast(data) { function calculateStarsCoupCast(data) {
let nuno = (data) => 3 let nuno = (data) => 3;
let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) let starsDecimal = average([nuno(data)]); //, eli(data), misha(data)])
let starsInteger = Math.round(starsDecimal) let starsInteger = Math.round(starsDecimal);
return starsInteger return starsInteger;
} }
function calculateStarsCSETForetell(data) { function calculateStarsCSETForetell(data) {
let nuno = (data) => data.numforecasts > 100 ? 3 : 2 let nuno = (data) => (data.numforecasts > 100 ? 3 : 2);
let eli = (data) => 3 let eli = (data) => 3;
let misha = (data) => 2 let misha = (data) => 2;
let starsDecimal = average([nuno(data), eli(data), misha(data)]) let starsDecimal = average([nuno(data), eli(data), misha(data)]);
let starsInteger = Math.round(starsDecimal) let starsInteger = Math.round(starsDecimal);
return starsInteger return starsInteger;
} }
function calculateStarsElicit(data) { function calculateStarsElicit(data) {
let nuno = data => 1 let nuno = (data) => 1;
let eli = (data) => null let eli = (data) => null;
let misha = (data) => null let misha = (data) => null;
let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) let starsDecimal = average([nuno(data)]); //, eli(data), misha(data)])
let starsInteger = Math.round(starsDecimal) let starsInteger = Math.round(starsDecimal);
return starsInteger return starsInteger;
} }
function calculateStarsEstimize(data) { function calculateStarsEstimize(data) {
let nuno = data => 2 let nuno = (data) => 2;
let eli = (data) => null let eli = (data) => null;
let misha = (data) => null let misha = (data) => null;
let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) let starsDecimal = average([nuno(data)]); //, eli(data), misha(data)])
let starsInteger = Math.round(starsDecimal) let starsInteger = Math.round(starsDecimal);
return starsInteger return starsInteger;
} }
function calculateStarsForetold(data) { function calculateStarsForetold(data) {
let nuno = data => 2 let nuno = (data) => 2;
let eli = (data) => null let eli = (data) => null;
let misha = (data) => null let misha = (data) => null;
let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) let starsDecimal = average([nuno(data)]); //, eli(data), misha(data)])
let starsInteger = Math.round(starsDecimal) let starsInteger = Math.round(starsDecimal);
return starsInteger return starsInteger;
} }
function calculateStarsGiveWellOpenPhil(data) { function calculateStarsGiveWellOpenPhil(data) {
let nuno = data => 2 let nuno = (data) => 2;
let eli = (data) => null let eli = (data) => null;
let misha = (data) => null let misha = (data) => null;
let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) let starsDecimal = average([nuno(data)]); //, eli(data), misha(data)])
let starsInteger = Math.round(starsDecimal) let starsInteger = Math.round(starsDecimal);
return starsInteger return starsInteger;
} }
function calculateStarsGoodJudment(data) { function calculateStarsGoodJudment(data) {
let nuno = data => 4 let nuno = (data) => 4;
let eli = (data) => 4 let eli = (data) => 4;
let misha = (data) => 3.5 let misha = (data) => 3.5;
let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) let starsDecimal = average([nuno(data)]); //, eli(data), misha(data)])
let starsInteger = Math.round(starsDecimal) let starsInteger = Math.round(starsDecimal);
return starsInteger return starsInteger;
} }
function calculateStarsGoodJudmentOpen(data) { function calculateStarsGoodJudmentOpen(data) {
let nuno = data => data.numforecasts > 100 ? 3 : 2 let nuno = (data) => (data.numforecasts > 100 ? 3 : 2);
let eli = (data) => 3 let eli = (data) => 3;
let misha = (data) => (data.minProbability > 0.1 || data.maxProbability < 0.9) ? 3.1 : 2.5 let misha = (data) =>
let starsDecimal = average([nuno(data), eli(data), misha(data)]) data.minProbability > 0.1 || data.maxProbability < 0.9 ? 3.1 : 2.5;
let starsInteger = Math.round(starsDecimal) let starsDecimal = average([nuno(data), eli(data), misha(data)]);
return starsInteger let starsInteger = Math.round(starsDecimal);
return starsInteger;
} }
function calculateStarsHypermind(data) { function calculateStarsHypermind(data) {
let nuno = data => 3 let nuno = (data) => 3;
let eli = (data) => null let eli = (data) => null;
let misha = (data) => null let misha = (data) => null;
let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) let starsDecimal = average([nuno(data)]); //, eli(data), misha(data)])
let starsInteger = Math.round(starsDecimal) let starsInteger = Math.round(starsDecimal);
return starsInteger return starsInteger;
} }
function calculateStarsKalshi(data) { function calculateStarsKalshi(data) {
let nuno = data => data.interest > 500 && data.shares_volume > 10000 ? 4 : (data.shares_volume > 2000 ? 3 : 2) let nuno = (data) =>
data.interest > 500 && data.shares_volume > 10000
? 4
: data.shares_volume > 2000
? 3
: 2;
// let eli = (data) => data.interest > 10000 ? 5 : 4 // let eli = (data) => data.interest > 10000 ? 5 : 4
// let misha = (data) => 4 // let misha = (data) => 4
let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) let starsDecimal = average([nuno(data)]); //, eli(data), misha(data)])
// Substract 1 star if probability is above 90% or below 10% // Substract 1 star if probability is above 90% or below 10%
if(data.option && if (
data.option &&
(data.option.probability < 0.1 || data.option.probability > 0.9) (data.option.probability < 0.1 || data.option.probability > 0.9)
){ ) {
starsDecimal = starsDecimal - 1 starsDecimal = starsDecimal - 1;
} }
let starsInteger = Math.round(starsDecimal) let starsInteger = Math.round(starsDecimal);
return starsInteger return starsInteger;
} }
function calculateStarsLadbrokes(data) { function calculateStarsLadbrokes(data) {
let nuno = data => 2 let nuno = (data) => 2;
let eli = (data) => null let eli = (data) => null;
let misha = (data) => null let misha = (data) => null;
let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) let starsDecimal = average([nuno(data)]); //, eli(data), misha(data)])
let starsInteger = Math.round(starsDecimal) let starsInteger = Math.round(starsDecimal);
return starsInteger return starsInteger;
} }
function calculateStarsManifoldMarkets(data) { function calculateStarsManifoldMarkets(data) {
let nuno = data => 2 let nuno = (data) =>
let eli = (data) => null data.volume7Days > 500 || (data.pool > 500 && data.volume7Days > 200)
let misha = (data) => null ? 2
let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) : 1;
let starsInteger = Math.round(starsDecimal) let eli = (data) => null;
return starsInteger let misha = (data) => null;
let starsDecimal = average([nuno(data)]); //, eli(data), misha(data)])
let starsInteger = Math.round(starsDecimal);
return starsInteger;
} }
function calculateStarsMetaculus(data) { function calculateStarsMetaculus(data) {
let nuno = data => data.numforecasts > 300 ? 4 : (data.numforecasts > 100 ? 3 : 2) let nuno = (data) =>
let eli = (data) => 3 data.numforecasts > 300 ? 4 : data.numforecasts > 100 ? 3 : 2;
let misha = (data) => 3 let eli = (data) => 3;
let starsDecimal = average([nuno(data), eli(data), misha(data)]) let misha = (data) => 3;
let starsInteger = Math.round(starsDecimal) let starsDecimal = average([nuno(data), eli(data), misha(data)]);
return starsInteger let starsInteger = Math.round(starsDecimal);
return starsInteger;
} }
function calculateStarsOmen(data) { function calculateStarsOmen(data) {
let nuno = data => 1 let nuno = (data) => 1;
let eli = (data) => null let eli = (data) => null;
let misha = (data) => null let misha = (data) => null;
let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) let starsDecimal = average([nuno(data)]); //, eli(data), misha(data)])
let starsInteger = Math.round(starsDecimal) let starsInteger = Math.round(starsDecimal);
return starsInteger return starsInteger;
} }
function calculateStarsPolymarket(data) { function calculateStarsPolymarket(data) {
let nuno = data => data.volume > 10000 ? 4 : (data.volume > 1000 ? 3 : 2) let nuno = (data) => (data.volume > 10000 ? 4 : data.volume > 1000 ? 3 : 2);
// let eli = (data) => data.liquidity > 10000 ? 5 : 4 // let eli = (data) => data.liquidity > 10000 ? 5 : 4
// let misha = (data) => 4 // let misha = (data) => 4
let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) let starsDecimal = average([nuno(data)]); //, eli(data), misha(data)])
// Substract 1 star if probability is above 90% or below 10% // Substract 1 star if probability is above 90% or below 10%
if(data.option && if (
data.option &&
(data.option.probability < 0.1 || data.option.probability > 0.9) (data.option.probability < 0.1 || data.option.probability > 0.9)
){ ) {
starsDecimal = starsDecimal - 1 starsDecimal = starsDecimal - 1;
} }
let starsInteger = Math.round(starsDecimal) let starsInteger = Math.round(starsDecimal);
return starsInteger return starsInteger;
} }
function calculateStarsPredictIt(data) { function calculateStarsPredictIt(data) {
let nuno = data => 3 let nuno = (data) => 3;
let eli = (data) => 3.5 let eli = (data) => 3.5;
let misha = (data) => 2.5 let misha = (data) => 2.5;
let starsDecimal = average([nuno(data), eli(data), misha(data)]) let starsDecimal = average([nuno(data), eli(data), misha(data)]);
let starsInteger = Math.round(starsDecimal) let starsInteger = Math.round(starsDecimal);
return starsInteger return starsInteger;
} }
function calculateStarsRootclaim(data) { function calculateStarsRootclaim(data) {
let nuno = data => 4 let nuno = (data) => 4;
let eli = (data) => null let eli = (data) => null;
let misha = (data) => null let misha = (data) => null;
let starsDecimal = average([nuno(data)/*, eli(data), misha(data)*/]) let starsDecimal = average([nuno(data) /*, eli(data), misha(data)*/]);
let starsInteger = Math.round(starsDecimal) let starsInteger = Math.round(starsDecimal);
return starsInteger return starsInteger;
} }
function calculateStarsSmarkets(data) { function calculateStarsSmarkets(data) {
let nuno = data => 2 let nuno = (data) => 2;
let eli = (data) => null let eli = (data) => null;
let misha = (data) => null let misha = (data) => null;
let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) let starsDecimal = average([nuno(data)]); //, eli(data), misha(data)])
let starsInteger = Math.round(starsDecimal) let starsInteger = Math.round(starsDecimal);
return starsInteger return starsInteger;
} }
function calculateStarsWildeford(data) { function calculateStarsWildeford(data) {
let nuno = data => 3 let nuno = (data) => 3;
let eli = (data) => null let eli = (data) => null;
let misha = (data) => null let misha = (data) => null;
let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) let starsDecimal = average([nuno(data)]); //, eli(data), misha(data)])
let starsInteger = Math.round(starsDecimal) let starsInteger = Math.round(starsDecimal);
return starsInteger return starsInteger;
} }
function calculateStarsWilliamHill(data) { function calculateStarsWilliamHill(data) {
let nuno = data => 2 let nuno = (data) => 2;
let eli = (data) => null let eli = (data) => null;
let misha = (data) => null let misha = (data) => null;
let starsDecimal = average([nuno(data)]) //, eli(data), misha(data)]) let starsDecimal = average([nuno(data)]); //, eli(data), misha(data)])
let starsInteger = Math.round(starsDecimal) let starsInteger = Math.round(starsDecimal);
return starsInteger return starsInteger;
} }
export function calculateStars(platform, data) { export function calculateStars(platform, data) {
let stars = 2; let stars = 2;
switch (platform) { switch (platform) {
case "AstralCodexTen": case "AstralCodexTen":
stars = calculateStarsAstralCodexTen(data) stars = calculateStarsAstralCodexTen(data);
break; break;
case "Betfair": case "Betfair":
stars = calculateStarsBetfair(data) stars = calculateStarsBetfair(data);
break; break;
case "CoupCast": case "CoupCast":
stars = calculateStarsCoupCast(data) stars = calculateStarsCoupCast(data);
break; break;
case "CSET-foretell": case "CSET-foretell":
stars = calculateStarsCSETForetell(data) stars = calculateStarsCSETForetell(data);
break; break;
case "Elicit": case "Elicit":
stars = calculateStarsElicit(data) stars = calculateStarsElicit(data);
break; break;
case "Estimize": case "Estimize":
stars = calculateStarsEstimize(data) stars = calculateStarsEstimize(data);
break; break;
case "Foretold": case "Foretold":
stars = calculateStarsForetold(data) stars = calculateStarsForetold(data);
break; break;
case "GiveWell/OpenPhilanthropy": case "GiveWell/OpenPhilanthropy":
stars = calculateStarsGiveWellOpenPhil(data) stars = calculateStarsGiveWellOpenPhil(data);
break; break;
case "Good Judgment": case "Good Judgment":
stars = calculateStarsGoodJudment(data) stars = calculateStarsGoodJudment(data);
break; break;
case "Good Judgment Open": case "Good Judgment Open":
stars = calculateStarsGoodJudmentOpen(data) stars = calculateStarsGoodJudmentOpen(data);
break; break;
case "Hypermind": case "Hypermind":
stars = calculateStarsHypermind(data) stars = calculateStarsHypermind(data);
break; break;
case "Kalshi": case "Kalshi":
stars = calculateStarsKalshi(data) stars = calculateStarsKalshi(data);
break; break;
case "Ladbrokes": case "Ladbrokes":
stars = calculateStarsLadbrokes(data) stars = calculateStarsLadbrokes(data);
break; break;
case "Manifold Markets": case "Manifold Markets":
stars = calculateStarsManifoldMarkets(data) stars = calculateStarsManifoldMarkets(data);
break; break;
case "Metaculus": case "Metaculus":
stars = calculateStarsMetaculus(data) stars = calculateStarsMetaculus(data);
break; break;
case "Omen": case "Omen":
stars = calculateStarsOmen(data) stars = calculateStarsOmen(data);
break; break;
case "Polymarket": case "Polymarket":
stars = calculateStarsPolymarket(data) stars = calculateStarsPolymarket(data);
break; break;
case "PredictIt": case "PredictIt":
stars = calculateStarsPredictIt(data) stars = calculateStarsPredictIt(data);
break; break;
case "Rootclaim": case "Rootclaim":
stars = calculateStarsRootclaim(data) stars = calculateStarsRootclaim(data);
break; break;
case "Smarkets": case "Smarkets":
stars = calculateStarsSmarkets(data) stars = calculateStarsSmarkets(data);
break; break;
case "Peter Wildeford": case "Peter Wildeford":
stars = calculateStarsWildeford(data) stars = calculateStarsWildeford(data);
break; break;
case "WilliamHill": case "WilliamHill":
stars = calculateStarsWilliamHill(data) stars = calculateStarsWilliamHill(data);
break; break;
default: default:
stars = 2 stars = 2;
} }
return stars return stars;
} }