Main entry point for experiment
()
| 184 | |
| 185 | |
| 186 | def main(): |
| 187 | """Main entry point for experiment""" |
| 188 | # Get the directory where this script is located |
| 189 | script_dir = os.path.dirname(os.path.abspath(__file__)) |
| 190 | |
| 191 | # Run experiment with default config (baseline) |
| 192 | results = run_experiment() |
| 193 | |
| 194 | # Save results |
| 195 | output = { |
| 196 | 'mse': results['metrics']['mse'], |
| 197 | 'r2': results['metrics']['r2'], |
| 198 | 'mae': results['metrics']['mae'], |
| 199 | 'training_time': results['training_time'], |
| 200 | 'config': results['config'] |
| 201 | } |
| 202 | |
| 203 | # Save to final_info.json in parent directory (run_X folder) |
| 204 | parent_dir = os.path.dirname(script_dir) |
| 205 | output_path = os.path.join(parent_dir, 'final_info.json') |
| 206 | |
| 207 | with open(output_path, 'w') as f: |
| 208 | json.dump(output, f, indent=2) |
| 209 | print(f"\nResults saved to: {output_path}") |
| 210 | |
| 211 | return output |
| 212 | |
| 213 | |
| 214 | if __name__ == '__main__': |
no test coverage detected