| #!/usr/bin/env python3 | |
| import os | |
| import json | |
| import matplotlib.pyplot as plt | |
| import pandas as pd | |
| from datetime import datetime | |
| def analyze_results(): | |
| results_dir = os.path.join(os.path.dirname(__file__), 'results') | |
| viz_dir = os.path.join(os.path.dirname(__file__), 'visualizations') | |
| print("๐ Performing Additional Analysis...") | |
| eval_file = os.path.join(results_dir, 'evaluation_results.json') | |
| if os.path.exists(eval_file): | |
| with open(eval_file, 'r') as f: | |
| eval_data = json.load(f) | |
| print(f"๐ Loaded evaluation data for {len(eval_data.get('results', []))} approaches") | |
| if 'results' in eval_data: | |
| approaches = [] | |
| metrics = ['accuracy', 'reasoning_quality', 'efficiency', 'interpretability', 'robustness'] | |
| for result in eval_data['results']: | |
| approach_data = {'Approach': result['approach']} | |
| for metric in metrics: | |
| approach_data[metric] = result.get(metric, 0.0) | |
| approaches.append(approach_data) | |
| df = pd.DataFrame(approaches) | |
| plt.figure(figsize=(10, 6)) | |
| df_metrics = df.set_index('Approach')[metrics] | |
| sns.heatmap(df_metrics.T, annot=True, cmap='YlOrRd', fmt='.3f') | |
| plt.title('Performance Metrics Heatmap') | |
| plt.tight_layout() | |
| plt.savefig(os.path.join(viz_dir, 'performance', 'metrics_heatmap.png'), dpi=300, bbox_inches='tight') | |
| plt.close() | |
| print("โ Performance heatmap generated") | |
| viz_files = [] | |
| for root, dirs, files in os.walk(viz_dir): | |
| for file in files: | |
| if file.endswith(('.png', '.jpg', '.pdf')): | |
| viz_files.append(os.path.join(root, file)) | |
| print(f"๐ Total visualizations generated: {len(viz_files)}") | |
| summary = { | |
| 'analysis_timestamp': datetime.now().isoformat(), | |
| 'total_visualizations': len(viz_files), | |
| 'visualization_categories': {}, | |
| 'file_sizes': {} | |
| } | |
| for file_path in viz_files: | |
| category = os.path.basename(os.path.dirname(file_path)) | |
| if category not in summary['visualization_categories']: | |
| summary['visualization_categories'][category] = 0 | |
| summary['visualization_categories'][category] += 1 | |
| file_size = os.path.getsize(file_path) | |
| summary['file_sizes'][os.path.basename(file_path)] = file_size | |
| with open(os.path.join(results_dir, 'analysis_summary.json'), 'w') as f: | |
| json.dump(summary, f, indent=2) | |
| print("โ Additional analysis completed!") | |
| if __name__ == "__main__": | |
| analyze_results() | |
Xet Storage Details
- Size:
- 2.76 kB
- Xet hash:
- 3b1c8705eb8e5a778d02261ae3fb50fdeaab94e9757dc9d24231c8c32bdf5edd
ยท
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.