Added timestamp + quality indicators

This commit is contained in:
NunoSempere 2021-04-07 22:29:21 +02:00
parent 01788da517
commit c83f2a747f
32 changed files with 77571 additions and 17707 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,9 @@
}
],
"description": "",
"stars": 1
"qualityindicators": {
"stars": 1
}
},
{
"title": "Will Joe Biden be the US President at the end of 2021?",
@ -35,6 +37,8 @@
}
],
"description": "",
"stars": 1
"qualityindicators": {
"stars": 1
}
}
]

File diff suppressed because it is too large Load Diff

View File

@ -105,9 +105,12 @@ async function fetchStats(questionUrl, cookie){
let result = {
"description": description,
"options": options,
"numforecasts": numforecasts,
"numforecasters": numforecasters,
"stars": calculateStars("CSET-foretell", {numforecasts})
"timestamp": new Date().toISOString(),
"qualityindicators": {
"numforecasts": numforecasts,
"numforecasters": numforecasters,
"stars": calculateStars("CSET-foretell", {numforecasts})
}
}
return result

View File

@ -70,9 +70,12 @@ function processArray(arrayQuestions) {
"type": "PROBABILITY"
}
],
"numforecasts": numforecasts,
"numforecasters": numforecasters,
"stars": calculateStars("Elicit", ({}))
"timestamp": new Date().toISOString(),
"qualityindicators": {
"numforecasts": numforecasts,
"numforecasters": numforecasters,
"stars": calculateStars("Elicit", ({}))
}
})
results.push(standardObj)
}

View File

@ -17,7 +17,12 @@ export function estimize(){
"platform": "Estimize",
"description": `A link to Estimize's forecasts for *${companyName}* (sticker symbol ${companyStickerSymbol}). Viewing them requires making a prediction, Wall Street estimates are provided for free`,
"options": [],
"stars": 2//calculateStars("Estimize", ({})),
"timestamp": new Date().toISOString(),
"qualityindicators": {
"numforecasts": numforecasts,
"numforecasters": numforecasters,
"stars": calculateStars("Estimize", ({})),
}
})
results.push(standardObj)
}

View File

@ -84,8 +84,11 @@ async function processData(data) {
"type": "PROBABILITY"
}
],
"numforecasts": predictionData.numForecasts,
"stars": calculateStars("FantasySCOTUS", ({}))
"timestamp": new Date().toISOString(),
"qualityindicators": {
"numforecasts": predictionData.numForecasts,
"stars": calculateStars("FantasySCOTUS", ({}))
}
})
console.log(eventObject)
results.push(eventObject)

View File

@ -77,8 +77,11 @@ export async function foretold(){
"platform": "Foretold",
"description": "",
"options": options,
"numforecasts": question.measurementCount / 2,
"stars": calculateStars("Foretold", ({ }))
"timestamp": new Date().toISOString(),
"qualityindicators": {
"numforecasts": question.measurementCount / 2,
"stars": calculateStars("Foretold", ({ }))
}
/*liquidity: liquidity.toFixed(2),
tradevolume: tradevolume.toFixed(2),
address: obj.address*/

View File

@ -45,7 +45,10 @@ async function main() {
"url": url,
"platform": "GiveWell",
"description": description,
"stars": calculateStars("GiveWell/OpenPhilanthropy", ({})),
"timestamp": new Date().toISOString(),
"qualityindicators": {
"stars": calculateStars("GiveWell/OpenPhilanthropy", ({})),
}
} // Note: This requires some processing afterwards
console.log(result)
results.push(result)

View File

@ -56,7 +56,10 @@ export async function goodjudgment() {
"platform": "Good Judgment",
"description": description,
"options": options,
"stars": calculateStars("Good Judgment", ({})),
"timestamp": new Date().toISOString(),
"qualityindicators": {
"stars": calculateStars("Good Judgment", ({})),
}
})
results.push(standardObj)
}

View File

@ -106,14 +106,16 @@ async function fetchStats(questionUrl, cookie) {
// Calculate the stars
let minProbability = Math.min(...options.map(option => option.probability))
let maxProbability = Math.max(...options.map(option => option.probability))
let stars = calculateStars("Good Judgment Open", ({ numforecasts, minProbability, maxProbability }))
let result = {
"description": description,
"options": options,
"numforecasts": numforecasts,
"numforecasters": numforecasters,
"stars": stars,
"timestamp": new Date().toISOString(),
"qualityindicators": {
"numforecasts": numforecasts,
"numforecasters": numforecasters,
"stars": calculateStars("Good Judgment Open", ({ numforecasts, minProbability, maxProbability }))
}
}
return result
}

View File

@ -138,11 +138,13 @@ export async function hypermind() {
"title": res.props.title.split("%%fr")[0].replace("%%en:", ""),
"url": "https://predict.hypermind.com/dash/dash/dash.html?list=" + slug,
"platform": "Hypermind",
"options": options,
"description": description,
"stars": calculateStars("Hypermind", ({})),
"options": options,
"timestamp": new Date().toISOString(),
"qualityindicators": {
"stars": calculateStars("Hypermind", ({})),
}
})
})
results1.push(...objs)
}
@ -163,8 +165,9 @@ export async function hypermind() {
"platform": "Hypermind",
"description": description,
"options": [],
"Percentage": "none",
"stars": 3
"qualityindicators": {
"stars": calculateStars("Hypermind", ({})),
}
})
})
@ -184,7 +187,9 @@ export async function hypermind() {
"platform": "Hypermind",
"description": description,
"options": [],
"stars": 3
"qualityindicators": {
"stars": calculateStars("Hypermind", ({})),
}
})
})
@ -200,7 +205,9 @@ export async function hypermind() {
"platform": "Hypermind",
"description": description,
"options": [],
"stars": 3
"qualityindicators": {
"stars": calculateStars("Hypermind", ({})),
}
})
})

View File

@ -54,22 +54,31 @@ let coverttocsvandmerge = async () => {
let mergedprocessed = merged.map(element => ({...element, optionsstringforsearch: element.options.map(option => option.name).join(", ")}))
writefile(JSON.stringify(mergedprocessed, null, 2), "metaforecasts", "", ".json")
/* Transform into a csv
let preparedforcsv = []
mergedprocessed.forEach(element => {
preparedforcsv.push({
"title": element.title,
"description": element.description,
"description": element.description?element.description.replaceAll("\n", " "):"",
"optionsstringforsearch": element.optionsstringforsearch
})
} )
} )
//console.log(preparedforcsv)
let mergedcsv = csvfromjson(preparedforcsv)
writefile(mergedcsv, "metaforecasts", "")
*/
console.log("Done")
}
let addtohistory = () => {
let currentJSON = fs.readFileSync(locationData + "metaforecasts.json")
let historyJSON = fs.readFileSync(locationData + "metaforecasts_history_bootstrap.json")
}
async function whattodo(message,callback){
const rl = readline.createInterface({
input: process.stdin,

View File

@ -56,7 +56,6 @@ let processResults = async (json) => {
"name":name,
"probability": probability,
"type": "PROBABILITY"
})
return option
})
@ -76,8 +75,12 @@ let processResults = async (json) => {
"title": title,
"url": "https://sports.ladbrokes.com/sport/politics/outrights",
"platform": "Ladbrokes",
"description": "",
"options": options,
"stars": calculateStars("Ladbrokes", ({}))
"timestamp": new Date().toISOString(),
"qualityindicators": {
"stars": calculateStars("Ladbrokes", ({}))
}
})
results.push(obj)
}
@ -109,12 +112,14 @@ let processResults = async (json) => {
"type": "PROBABILITY"
}
],
"stars": calculateStars("Ladbrokes", ({}))
"qualityindicators": {
"stars": calculateStars("Ladbrokes", ({}))
}
})
results.push(obj)
})
}
return results
return results
}
/* Body */

View File

@ -104,16 +104,18 @@ export async function metaculus() {
"title": result.title,
"url": "https://www.metaculus.com" + result.page_url,
"platform": "Metaculus",
"options": options,
"description": description,
"numforecasts": result.number_of_predictions,
"stars": calculateStars("Metaculus", ({ numforecasts: result.number_of_predictions })),
"resolution_data": {
"publish_time": result.publish_time,
"resolution": result.resolution,
"close_time": result.close_time,
"resolve_time": result.resolve_time
"options": options,
"timestamp": new Date().toISOString(),
"qualityindicators": {
"numforecasts": result.number_of_predictions,
"resolution_data": {
"publish_time": result.publish_time,
"resolution": result.resolution,
"close_time": result.close_time,
"resolve_time": result.resolve_time
},
"stars": calculateStars("Metaculus", ({ numforecasts: result.number_of_predictions }))
}
//"status": result.status,
//"publish_time": result.publish_time,

View File

@ -27,11 +27,14 @@ for(let datum of data){
"probability": 1-Math.round(probability*100)/100,
"type": "PROBABILITY"
}
],
"stars": datum["Stars"]
],
"timestamp": "2021-02-23T152137.005Z",//new Date().toISOString(),
"qualityindicators": {
"stars": datum["Stars"]
}
})
results.push(result)
}
let string = JSON.stringify(results,null, 2)
fs.writeFileSync("../data/givewellopenphil-questions.json", string)
fs.writeFileSync("../data/givewellopenphil-questions-new.json", string)

View File

@ -33,10 +33,13 @@ ${datum["description"]}` : datum["description"]
"type": "PROBABILITY"
}
],
"stars": 2
"timestamp": new Date().toISOString(),
"qualityindicators": {
"stars": 2//datum["stars"]
}
})
results.push(result)
}
let string = JSON.stringify(results,null, 2)
fs.writeFileSync("/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current/data/xrisk-questions.json", string)
fs.writeFileSync("/home/nuno/Documents/core/software/fresh/js/metaforecasts/metaforecasts-current/data/xrisk-questions-new.json", string)

View File

@ -69,9 +69,12 @@ async function fetch_all() {
"title": data.question.title,
"url": "https://omen.eth.link/#/" + data.id,
"platform": "Omen",
"options": options,
"description": "",
"stars": calculateStars("Omen", ({}))
"options": options,
"timestamp": new Date().toISOString(),
"qualityindicators": {
"stars": calculateStars("Omen", ({}))
}
}
console.log(obj)
results.push(obj)

View File

@ -107,11 +107,16 @@ async function fetch_all() {
"platform": "PolyMarket",
"description": obj.description,
"options": options,
"numforecasts": Number(data.tradesQuantity).toFixed(0),
"stars": calculateStars("Polymarket", ({ liquidity, option: options[0] }))
/*liquidity: liquidity.toFixed(2),
tradevolume: tradevolume.toFixed(2),
address: obj.address*/
"timestamp": new Date().toISOString(),
"qualityindicators": {
"numforecasts": Number(data.tradesQuantity).toFixed(0),
"liquidity": liquidity.toFixed(2),
"tradevolume": tradevolume.toFixed(2),
"stars": calculateStars("Polymarket", ({ liquidity, option: options[0] }))
}
/*
address: obj.address
*/
}
}
}

View File

@ -75,9 +75,13 @@ export async function predictit() {
"title": market["name"],
"url": market.url,
"platform": "PredictIt",
"options": options,
"description": description,
"stars": calculateStars("PredictIt", ({}))
"options": options,
"timestamp": new Date().toISOString(),
"qualityindicators": {
"stars": calculateStars("PredictIt", ({}))
}
})
console.log(obj)
result.push(obj)

View File

@ -137,9 +137,13 @@ export async function smarkets() {
"title": name,
"url": "https://smarkets.com/event/" + market.event_id + market.slug,
"platform": "Smarkets",
"options": options,
"description": market.description,
"stars": calculateStars("Smarkets", ({}))
"options": options,
"timestamp": new Date().toISOString(),
"qualityindicators": {
"stars": calculateStars("Smarkets", ({}))
}
}
//console.log(result)
results.push(result)

View File

@ -46,6 +46,8 @@ let processResults = (html) => {
"title": title,
"url": "https://sports.williamhill.com/betting/en-gb/politics",
"platform": "WilliamHill",
"description": "",
"timestamp": new Date().toISOString(),
"options": [
{
"name": "Yes",
@ -101,7 +103,9 @@ let processResults = (html) => {
"url": "https://sports.williamhill.com/betting/en-gb/politics",
"platform": "WilliamHill",
"options": options,
"stars": calculateStars("WilliamHill", ({}))
"qualityindicators": {
"stars": calculateStars("WilliamHill", ({}))
}
})
results.push(obj)
}