Views
No views yet
| File | Fix |
|---|---|
dataset.py | Moved dead code (methods after create_dataloaders return) back into GaitPathologyDataset class; removed duplicate __len__/__getitem__ |
train.py | Changed all 4 model init branches from input_dim=5 → input_dim=input_dim (uses dynamic feature count) |
evaluate.py | Added missing input_dim argument to load_model() call (was passing 3 args to 4-param function) |
inspect_data.py | Removed hardcoded C:\Users\ASUS\... path; added argparse; fixed pd.read_csv to use header=None |
gait_phase.py | Changed fallback values from hardcoded healthy-gait numbers to float('nan') when cycle detection fails |
EDA/eda_features.py | Added gp_extraction_failed column to track which windows had failed gait phase extraction |
EDA/eda_visualization.py | PCA/LDA/ICA/correlation now use patient-level aggregation; waveform plots pick median-representative patient |
EDA/permutation_importance.py | Complete rewrite: patient-level GroupKFold CV, no StandardScaler, cross-validated importance, diagnostics |
dataset.py (P0)_extract_legacy_features, _get_cache_path, _load_or_compute_features, etc. were defined after create_dataloaders() return — outside the class body. They were dead code that never executed.input_dim=5 in train.py (P0)input_dim=5, ignoring the dynamic input_dim variable computed from the dataset. Enhanced features (17+) would crash or silently truncate.evaluate.py (P0)load_model(args, num_classes, device) called with 3 args but function expects 4: load_model(args, input_dim, num_classes, device).train_test_split guaranteed overlapping windows from the same patient in both train and test. Test accuracy was inflated and importance rankings were wrong.stance_duration=62.0) were injected regardless of actual pathology class.| Flaw | Before | After |
|---|---|---|
| Split level | Window-level (leaks patient data) | Patient-level GroupKFold |
| Effective n | 961 windows (fake) | 38 patients (real) |
| Window correlation | r ≈ 0.97 between adjacent windows | Eliminated by grouping |
| Feature scaling | StandardScaler (distorts RF importance) | None (RF is scale-invariant) |
| Stability | Single 70/30 split | K-fold CV averaged |
| Fallback features | 151 rows with identical healthy-gait values | NaN → 0 with failure flag |