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 */
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 = ["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 = [
"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 merged = []
for(let set of sets){
let json = await mongoRead(set+suffix)
console.log(`${set} has ${json.length} questions\n`)
merged = merged.concat(json)
let suffix = "-questions";
export async function mergeEverythingInner() {
let merged = [];
for (let set of sets) {
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(", ")}))
console.log(`In total, there are ${mergedprocessed.length} questions`)
return mergedprocessed
let mergedprocessed = merged.map((element) => ({
...element,
optionsstringforsearch: element.options
.map((option) => option.name)
.join(", "),
}));
console.log(`In total, there are ${mergedprocessed.length} questions`);
return mergedprocessed;
}
export async function mergeEverything(){
let merged = await mergeEverythingInner()
await upsert( merged,"metaforecasts")
console.log("Done")
export async function mergeEverything() {
let merged = await mergeEverythingInner();
await upsert(merged, "metaforecasts");
console.log("Done");
}

View File

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