# Function calculateRegret

Learning exports - Closed-loop feedback and routing improvement Split from index.ts for file size compliance (Issue #285)

- calculateRegret(
  decisions: readonly {
  chosenModel: string;
  actualReward: number;
  rewards: Record<string, number>;
  }[],
  ): RegretAnalysis

  Calculate regret analysis comparing actual decisions vs oracle (best possible).

  #### Parameters

  - decisions: readonly {
    chosenModel: string;
    actualReward: number;
    rewards: Record<string, number>;
    }[]

  #### Returns RegretAnalysis

  - Defined in packages/nexus-agents/src/learning/validation-stats.ts:214