@@ -60,6 +60,10 @@ export interface FeatureImportanceItem {
6060 feature : string ;
6161 importance : number ;
6262}
63+ export interface ROCPoint {
64+ fpr : number ;
65+ tpr : number ;
66+ }
6367
6468export interface MLMetrics {
6569 accuracy : number ;
@@ -76,6 +80,7 @@ export interface MLMetrics {
7680 threshold : number ;
7781 evaluated_at ?: string ;
7882 feature_importance ?: FeatureImportanceItem [ ] ;
83+ roc_curve : ROCPoint [ ] ;
7984 calibration ?: {
8085 precision_target : number | null ;
8186 calibration_precision : number ;
@@ -105,6 +110,7 @@ export interface SupervisedModelResult {
105110 feature_importance : FeatureImportanceItem [ ] ;
106111 feature_importance_label : string ;
107112 train_seconds : number ;
113+ roc_curve : ROCPoint [ ] ;
108114}
109115
110116export interface SupervisedComparison {
@@ -145,6 +151,37 @@ export interface LanlComparison {
145151 note : string ;
146152}
147153
154+ // Standalone QSVM subsample experiment (train_qsvm.py) - NOT part of
155+ // SupervisedComparison's models[] array. Different sample size and
156+ // PCA-reduced feature space than the other supervised models, so it's
157+ // kept as its own type/endpoint rather than shoehorned into
158+ // SupervisedModelResult, to avoid implying a 1:1 comparison.
159+ export interface QsvmExperiment {
160+ model_key : "qsvm" ;
161+ model : string ;
162+ accuracy : number ;
163+ precision : number ;
164+ recall : number ;
165+ f1 : number ;
166+ roc_auc : number ;
167+ pr_auc : number ;
168+ tn : number ;
169+ fp : number ;
170+ fn : number ;
171+ tp : number ;
172+ threshold : number ;
173+ train_seconds : number ;
174+ sample_size : number ;
175+ train_size : number ;
176+ cal_size : number ;
177+ test_size : number ;
178+ n_qubits : number ;
179+ pca_explained_variance : number ;
180+ feature_map : string ;
181+ roc_curve : ROCPoint [ ] ;
182+ note : string ;
183+ }
184+
148185async function getJSON < T > ( path : string ) : Promise < T > {
149186 const response = await fetch ( `${ API_BASE } ${ path } ` ) ;
150187 if ( ! response . ok ) {
@@ -166,6 +203,7 @@ export const api = {
166203 getMLMetrics : ( ) => getJSON < MLMetrics > ( "/ml" ) ,
167204 getSupervisedComparison : ( ) => getJSON < SupervisedComparison | null > ( "/ml/supervised-comparison" ) ,
168205 getLanlComparison : ( ) => getJSON < LanlComparison | null > ( "/ml/lanl-comparison" ) ,
206+ getQsvmExperiment : ( ) => getJSON < QsvmExperiment | null > ( "/ml/qsvm-experiment" ) ,
169207 getSystemStatus : ( ) => getJSON < SystemStatus > ( "/system" ) ,
170208} ;
171209
0 commit comments