Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/AI_Brain / daemon/seed_statistics.py |
| Date | Not specified in source |
| Repository | Janady13/AI_Brain |
| Revision | 11aa50ef5d7692e8abd1b8d74ae31c5c29201b14 |
| Branch | codex/build-online-github-ani-irqa7y |
| Path or archive member | daemon/seed_statistics.py |
| Original SHA-256 | a8ff3f2239cdac11fccf4038f08b0f9abafa4c3f7935b3409e09bcac0dfe9dad |
| Git blob SHA | e852206acb7f3f1a5f7bc211d92cff6338abb6f6 |
| Reading-copy SHA-256 | a8ff3f2239cdac11fccf4038f08b0f9abafa4c3f7935b3409e09bcac0dfe9dad |
Every recorded occurrence
These 15 records contain identical original source bytes. Their paths and revisions remain part of the archive.
| Original record | Branch or archive | Revision / identifier | Original location |
|---|---|---|---|
| Janady13/AI_Brain / daemon/seed_statistics.py | codex/build-online-github-ani-irqa7y | 11aa50ef5d7692e8abd1b8d74ae31c5c29201b14 | Open original |
| Janady13/AI_Brain / daemon/seed_statistics.py | codex/build-online-github-ani-i3cigl | 3a6e002311c48c27ffd41ef4a2a31c63947128cd | Open original |
| Janady13/AI_Brain / daemon/seed_statistics.py | codex/build-online-github-ani-hrtsoc | 50285aff347685f043e7a72e4d72891eebaa6cd6 | Open original |
| Janady13/AI_Brain / daemon/seed_statistics.py | codex/build-online-github-ani-7v4kug | 5cd0bbf744b0aee9445913337e852889d9a8098e | Open original |
| Janady13/AI_Brain / daemon/seed_statistics.py | copilot/vscode1760283895982 | 9e1c1a5b171addb5bb4a83b2ea7dede50c1cc81e | Open original |
| Janady13/AI_Brain / daemon/seed_statistics.py | feature/seeder-engine-tests | cdb497ece2d1a770ca8c83eb1de8923cfaa9eceb | Open original |
| Janady13/AI_Brain / daemon/seed_statistics.py | codex/build-online-github-ani-7nmb21 | d0f50071c85cddaaebbf9c4dd1313bd7676986da | Open original |
| Janady13/AI_Brain / daemon/seed_statistics.py | codex/build-online-github-ani-0etkns | e250b19d446bdffd542c9eea31cead12e30800d6 | Open original |
| Janady13/AI_Brain / daemon/seed_statistics.py | codex/build-online-github-ani-irqa7y | 11aa50ef5d7692e8abd1b8d74ae31c5c29201b14 | Open original |
| Janady13/AI_Brain / daemon/seed_statistics.py | codex/build-online-github-ani-i3cigl | 3a6e002311c48c27ffd41ef4a2a31c63947128cd | Open original |
| Janady13/AI_Brain / daemon/seed_statistics.py | codex/build-online-github-ani-7v4kug | 5cd0bbf744b0aee9445913337e852889d9a8098e | Open original |
| Janady13/AI_Brain / daemon/seed_statistics.py | copilot/vscode1760283895982 | 9e1c1a5b171addb5bb4a83b2ea7dede50c1cc81e | Open original |
| Janady13/AI_Brain / daemon/seed_statistics.py | codex/build-online-github-ani-7nmb21 | d0f50071c85cddaaebbf9c4dd1313bd7676986da | Open original |
| Janady13/AI_Brain / daemon/seed_statistics.py | feature/seeder-engine-tests | cdb497ece2d1a770ca8c83eb1de8923cfaa9eceb | Open original |
| Janady13/AI_Brain / daemon/seed_statistics.py | codex/build-online-github-ani-hrtsoc | 50285aff347685f043e7a72e4d72891eebaa6cd6 | Open original |
Recovered source transcript
Download complete source text ↓116 lines · 4.1 KB
#!/usr/bin/env python3
from __future__ import annotations
import json
import math
import os
from typing import Iterable
from seed_common import run_seed
STATISTICAL_PRIORS_PATH = os.path.join(
os.path.dirname(__file__), "datasets", "statistical_reasoning.json"
)
def _load_priors() -> list[dict[str, object]]:
try:
with open(STATISTICAL_PRIORS_PATH, "r", encoding="utf-8") as handle:
payload = json.load(handle)
except (FileNotFoundError, json.JSONDecodeError): # pragma: no cover - offline fallback
payload = []
if isinstance(payload, list):
return [entry for entry in payload if isinstance(entry, dict)]
return []
def gen_statistics(limit: int) -> Iterable[str]:
priors = _load_priors()
if not priors:
priors = [
{
"feature": "omni-channel",
"feature_type": "channel",
"mean_roi": 2.2,
"std_roi": 0.5,
"mean_ctr": 0.038,
"std_ctr": 0.012,
"sample_size": 150,
"weight": 0.8,
"baseline_budget": 20000,
"notes": "Fallback statistical prior when curated dataset missing.",
}
]
scenarios = [
"baseline",
"aggressive",
"defensive",
"innovation",
"efficiency",
"expansion",
"stabilization",
"premium",
"retention",
"accelerated",
]
confidence_levels = [0.68, 0.8, 0.9, 0.95]
budget_multipliers = [0.75, 0.9, 1.0, 1.1, 1.25]
produced = 0
for prior in priors:
feature = prior.get("feature", "unspecified")
feature_type = str(prior.get("feature_type", "feature"))
mean_roi = float(prior.get("mean_roi", 2.0))
std_roi = float(prior.get("std_roi", 0.5))
mean_ctr = float(prior.get("mean_ctr", 0.03))
std_ctr = float(prior.get("std_ctr", 0.01))
sample_size = int(prior.get("sample_size", 100))
weight = float(prior.get("weight", 0.75))
baseline_budget = float(prior.get("baseline_budget", 20000))
notes = str(prior.get("notes", "Statistical benchmark from curated marketing runs."))
for scenario in scenarios:
for confidence in confidence_levels:
z_score = {
0.68: 0.994,
0.8: 1.282,
0.9: 1.645,
0.95: 1.96,
}.get(confidence, 1.96)
margin_roi = round(z_score * std_roi / math.sqrt(max(sample_size, 1)), 3)
margin_ctr = round(z_score * std_ctr / math.sqrt(max(sample_size, 1)), 4)
for multiplier in budget_multipliers:
scenario_budget = round(baseline_budget * multiplier, 2)
projected_revenue = round(scenario_budget * mean_roi, 2)
statement = (
"Statistical prior: {scenario} strategy for {feature_type} "
"'{feature}' targets ROI {mean_roi:.3f}x ±{margin_roi:.3f} ({confidence:.0%} CI) "
"and CTR {mean_ctr:.4f} ±{margin_ctr:.4f} from {sample_size} runs; "
"allocate ${budget:,.2f} to unlock ${revenue:,.2f} with weights {weight:.2f}. Notes: {notes}"
).format(
scenario=scenario.title(),
feature_type=feature_type,
feature=feature,
mean_roi=mean_roi,
margin_roi=margin_roi,
confidence=confidence,
mean_ctr=mean_ctr,
margin_ctr=margin_ctr,
sample_size=sample_size,
budget=scenario_budget,
revenue=projected_revenue,
weight=weight,
notes=notes,
)
yield statement
produced += 1
if produced >= limit:
return
if __name__ == "__main__":
run_seed("statistics", gen_statistics)