mirror of
https://github.com/theodore-song/polymarket-analyst.git
synced 2026-08-19 18:48:10 +00:00
Align adaptation with audited outcomes
This commit is contained in:
@@ -208,4 +208,24 @@ const report = {
|
||||
return [horizon, { observations: horizonRows.length / 2, chronological: chronologicalEvaluation(horizonRows) }];
|
||||
})),
|
||||
};
|
||||
console.log(JSON.stringify(report, null, 2));
|
||||
const compact = process.env.SETTLEMENT_SUMMARY === "1";
|
||||
const compactStats = (stats = {}) => ({ count: stats.count || 0, events: stats.events || 0,
|
||||
mean: stats.mean || 0, eventMean: stats.eventMean || 0, eventLower90: stats.eventLower90 || 0,
|
||||
eventUpper90: stats.eventUpper90 || 0, winRate: stats.winRate || 0 });
|
||||
const compactRules = (rules = {}) => Object.fromEntries(Object.entries(rules)
|
||||
.filter(([, result]) => result.enoughData && (result.allPositive || result.allNegative))
|
||||
.map(([name, result]) => [name, { direction: result.allPositive ? "positive" : "negative",
|
||||
pooled: compactStats(result.pooled), train: compactStats(result.train), test: compactStats(result.test) }]));
|
||||
const summary = {
|
||||
generatedAt: report.generatedAt, requestedMarkets: report.requestedMarkets, resolvedMarkets: report.resolvedMarkets,
|
||||
marketsWithHistory: report.marketsWithHistory, failures: report.failures,
|
||||
horizons: Object.fromEntries(Object.entries(report.horizons).map(([days, value]) => [days, {
|
||||
observations: value.observations,
|
||||
favorite: compactStats(value.chronological.train.buy_favorite),
|
||||
favoriteTest: compactStats(value.chronological.test.buy_favorite),
|
||||
underdog: compactStats(value.chronological.train.buy_underdog),
|
||||
underdogTest: compactStats(value.chronological.test.buy_underdog),
|
||||
robustRules: compactRules(value.chronological.robustRules),
|
||||
}])),
|
||||
};
|
||||
console.log(JSON.stringify(compact ? summary : report, null, 2));
|
||||
|
||||
@@ -254,4 +254,28 @@ const report = {
|
||||
})),
|
||||
failures: histories.filter((result) => result?.error).length,
|
||||
};
|
||||
console.log(JSON.stringify(report, null, 2));
|
||||
const compact = process.env.EVAL_SUMMARY === "1";
|
||||
const compactStats = (stats = {}) => ({ count: stats.count || 0, markets: stats.markets || 0,
|
||||
mean: stats.mean || 0, marketMean: stats.marketMean || 0, lower90: stats.lower90 || 0, upper90: stats.upper90 || 0,
|
||||
winRate: stats.winRate || 0 });
|
||||
const compactRules = (rules = {}) => Object.fromEntries(Object.entries(rules)
|
||||
.filter(([, result]) => result.enoughData && (result.allPositive || result.allNegative))
|
||||
.map(([name, result]) => [name, { direction: result.allPositive ? "positive" : "negative",
|
||||
minimumSegmentMean: result.minimumSegmentMean, maximumSegmentMean: result.maximumSegmentMean,
|
||||
pooled: compactStats(result.pooled) }]));
|
||||
const summary = {
|
||||
generatedAt: report.generatedAt, marketLimit: report.marketLimit, marketsWithHistory: report.marketsWithHistory,
|
||||
primaryHorizon: report.methodology.primaryHorizon, failures: report.failures,
|
||||
overall: compactStats(report.overall),
|
||||
byType: Object.fromEntries(Object.entries(report.byType).map(([key, value]) => [key, compactStats(value)])),
|
||||
byCategory: Object.fromEntries(Object.entries(report.byCategory).map(([key, value]) => [key, compactStats(value)])),
|
||||
byBand: Object.fromEntries(Object.entries(report.byBand).map(([key, value]) => [key, compactStats(value)])),
|
||||
bySide: Object.fromEntries(Object.entries(report.bySide).map(([key, value]) => [key, compactStats(value)])),
|
||||
train: compactStats(report.chronologicalSplit.train.follow_all),
|
||||
test: compactStats(report.chronologicalSplit.test.follow_all),
|
||||
robustRules: compactRules(report.chronologicalSplit.robustRules),
|
||||
horizons: Object.fromEntries(Object.entries(report.horizons).map(([hours, value]) => [hours, {
|
||||
overall: compactStats(value.overall), robustRules: compactRules(value.chronological.robustRules),
|
||||
}])),
|
||||
};
|
||||
console.log(JSON.stringify(compact ? summary : report, null, 2));
|
||||
|
||||
Reference in New Issue
Block a user