Spaces:
Sleeping
Sleeping
| import pandas as pd | |
| import numpy as np | |
| import pickle | |
| import os | |
| import sys | |
| # Add path to find models | |
| sys.path.append(os.getcwd()) | |
| from models.causal_discovery import get_causal_model | |
| # Mock Data | |
| df = pd.DataFrame(np.random.randn(100, 5), columns=['open', 'high', 'low', 'close', 'volume']) | |
| clean_df = df | |
| print("Init Causal...") | |
| model = get_causal_model() | |
| print("Fit Causal...") | |
| model.fit(clean_df) | |
| print("Pickle Causal...") | |
| with open("causal_debug.pkl", "wb") as f: | |
| pickle.dump(model, f) | |
| print("✅ Success") | |