import { useEffect, useState } from 'react'
import { api, API_BASE } from '../lib/api'
function MetricCard({ label, value, target, meetsTarget }) {
return (
{label}
{value}
Target: {target}
)
}
function ClassifierSection({ title, metrics, confusionMatrixUrl, targetLabel, targetValue, actualKey, formatFn }) {
if (!metrics) {
return (
{title}: no evaluation results found yet.
)
}
const meetsTarget = metrics.meets_prd_target
const actual = formatFn(metrics[actualKey])
return (
{title}
{!meetsTarget && (
This model does not currently meet the PRD's target. See the project write-up for the documented
root cause and iteration history — this is a disclosed, known limitation, not a hidden gap.
)}
Confusion Matrix (Test Set, {metrics.n_test_examples} examples)
)
}
export default function ModelPerformance() {
const [data, setData] = useState(null)
useEffect(() => {
api.modelPerformance().then(setData)
}, [])
if (!data) return Loading model performance…
return (
Model Performance
Real results on the held-out test set — reported honestly, including where targets weren't met.
`${(v * 100).toFixed(1)}%`}
/>
v.toFixed(3)}
/>
)
}