File size: 1,126 Bytes
e4a8a19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""
Simple test script to verify the Huggingface app works locally.
This will run the app with synthetic data.
"""
import numpy as np
import pandas as pd
import os

# Ensure directories exist
os.makedirs('results', exist_ok=True)
os.makedirs('models', exist_ok=True)

# Create synthetic data
print("Creating synthetic test data...")
n_samples = 10
n_features = 100

# Create FC matrix data
fc_data = np.random.randn(n_samples, n_features)
np.save('results/test_fc.npy', fc_data)
print(f"Saved FC matrix data to results/test_fc.npy with shape {fc_data.shape}")

# Create demographics data
demo_df = pd.DataFrame({
    'age': np.random.normal(60, 10, n_samples),
    'sex': np.random.choice(['M', 'F'], n_samples),
    'months_post_stroke': np.random.normal(24, 12, n_samples),
    'wab_score': np.random.normal(65, 15, n_samples)
})
demo_df.to_csv('results/test_demographics.csv', index=False)
print(f"Saved demographics data to results/test_demographics.csv with shape {demo_df.shape}")

print("\nTest data created successfully!")
print("\nNow you can run: python app.py")
print("Then upload the test files to train a model.")