Spaces:
Runtime error
Runtime error
| import sys | |
| import traceback | |
| try: | |
| print("1. Loading config...") | |
| from src.config_loader import get_config | |
| get_config() | |
| print("2. Importing pipeline...") | |
| from src.data_loader import get_processed_data | |
| from src.graph_builder import build_graph, compute_pagerank, compute_betweenness, compute_louvain | |
| from src.detectors.alert_engine import get_all_alerts | |
| from src.ml.features import engineer_features | |
| print("3. Getting data...") | |
| df, node_features = get_processed_data() | |
| print(f"Loaded {len(df)} rows.") | |
| print("4. Building graph...") | |
| graph = build_graph(df) | |
| print(f"Graph: {len(graph.nodes)} nodes, {len(graph.edges)} edges.") | |
| print("5. Metrics...") | |
| pr = compute_pagerank(1, graph) | |
| bw = compute_betweenness(1, graph) | |
| lv = compute_louvain(1, graph) | |
| print("6. Detectors...") | |
| alerts = get_all_alerts(df, graph, lv, node_features, demo_mode=True) | |
| print(f"Generated {len(alerts)} alerts.") | |
| print("7. Features...") | |
| ff = engineer_features(df, graph, pr, bw, lv, alerts) | |
| print(f"Feature cols: {len(ff.columns)}") | |
| print("SUCCESS!") | |
| except Exception: | |
| print("\n--- ERROR CAUGHT ---") | |
| traceback.print_exc() | |
| sys.exit(1) | |