File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,13 @@ const createFormSchema = (t: (key: string) => string) =>
2222 sdgMethod : z . string ( ) ,
2323 } ) ;
2424
25+ interface DemoDataColumns {
26+ sex : string ;
27+ race1 : string ;
28+ ugpa : string ;
29+ bar : string ;
30+ }
31+
2532export default function BiasSettings ( {
2633 onRun,
2734 onDataLoad,
@@ -75,9 +82,16 @@ export default function BiasSettings({
7582 const file = await fetch ( '/Bar-Pass-Prediction.csv' )
7683 . then ( response => response . text ( ) )
7784 . then ( data => Papa . parse ( data , { header : true } ) ) ;
85+
86+ const demoData = file . data . map ( ( row : unknown ) => ( {
87+ sex : ( row as DemoDataColumns ) [ 'sex' ] ,
88+ race1 : ( row as DemoDataColumns ) [ 'race1' ] ,
89+ ugpa : ( row as DemoDataColumns ) [ 'ugpa' ] ,
90+ bar : ( row as DemoDataColumns ) [ 'bar' ] ,
91+ } ) ) ;
7892 onDataLoad (
79- file . data as Record < string , string > [ ] ,
80- Papa . unparse ( file . data ) ,
93+ demoData as Record < string , string > [ ] ,
94+ Papa . unparse ( demoData ) ,
8195 'demo' ,
8296 true
8397 ) ;
You can’t perform that action at this time.
0 commit comments