Skip to content

Commit 19659f8

Browse files
committed
volgorde headings
1 parent f5ea126 commit 19659f8

File tree

1 file changed

+30
-27
lines changed

1 file changed

+30
-27
lines changed

src/assets/synthetic-data.tsx

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -210,33 +210,7 @@ def run():
210210
211211
results = run_diagnostic(real_data, synthetic_data, target_column='gpa')
212212
print('Results:', results)
213-
setResult(json.dumps(
214-
{'type': 'heading', 'data': 'Diagnostic Results:'}
215-
))
216-
setResult(json.dumps({'type': 'table',
217-
'showIndex' : False,
218-
'data': json.dumps([
219-
{
220-
'attribute': key,
221-
'ks_stat': values['ks_stat'],
222-
'p_value': values['p_value']
223-
}
224-
for key, values in results['distribution_results'].items()
225-
])}))
226-
227-
setResult(json.dumps(
228-
{'type': 'heading', 'data': 'Correlation difference: ' + str(results['correlation_diff']) }
229-
))
230-
231-
setResult(json.dumps(
232-
{'type': 'heading', 'data': '5. Output data'}
233-
))
234-
setResult(json.dumps({
235-
'type': 'table',
236-
'showIndex': True,
237-
'data': synthetic_data.head().to_json(orient="records")
238-
}))
239-
213+
240214
241215
# copy dataframe and assign NaN to all values
242216
synth_df = real_data.copy()
@@ -266,6 +240,35 @@ def run():
266240
# 'synthetic': synthetic_data.corr().to_json(orient="records")
267241
# }))
268242
243+
setResult(json.dumps(
244+
{'type': 'heading', 'data': 'Diagnostic Results:'}
245+
))
246+
setResult(json.dumps({'type': 'table',
247+
'showIndex' : False,
248+
'data': json.dumps([
249+
{
250+
'attribute': key,
251+
'ks_stat': values['ks_stat'],
252+
'p_value': values['p_value']
253+
}
254+
for key, values in results['distribution_results'].items()
255+
])}))
256+
257+
setResult(json.dumps(
258+
{'type': 'heading', 'data': 'Correlation difference: ' + str(results['correlation_diff']) }
259+
))
260+
261+
setResult(json.dumps({
262+
'type': 'heading',
263+
'data': '5. Output data'
264+
}))
265+
266+
setResult(json.dumps({
267+
'type': 'table',
268+
'showIndex': True,
269+
'data': synthetic_data.head().to_json(orient="records")
270+
}))
271+
269272
return
270273
271274

0 commit comments

Comments
 (0)