2022-01-09 20:00:03 +01:00
|
|
|
from run_pipeline import run_pipeline
|
2022-01-26 23:22:43 +01:00
|
|
|
from config import get_default_ensemble_config, get_dev_config
|
2022-01-09 20:00:03 +01:00
|
|
|
import pandas as pd
|
|
|
|
|
|
|
|
|
|
all_results = []
|
|
|
|
|
all_predictions = []
|
|
|
|
|
for index in range(6):
|
2022-02-17 19:22:17 +01:00
|
|
|
_, _, _, _, results_1, predictions_1, _ = run_pipeline(
|
|
|
|
|
project_name="price-prediction",
|
|
|
|
|
with_wandb=False,
|
|
|
|
|
config=get_default_ensemble_config(),
|
|
|
|
|
)
|
2022-01-09 20:00:03 +01:00
|
|
|
all_results.append(results_1)
|
|
|
|
|
all_predictions.append(predictions_1)
|
|
|
|
|
|
2022-01-10 14:17:06 +01:00
|
|
|
correlations = pd.Series()
|
2022-01-09 20:00:03 +01:00
|
|
|
|
2022-02-17 19:22:17 +01:00
|
|
|
for asset_name in [c for c in all_predictions[0].columns if "ensemble" in c]:
|
2022-01-09 20:00:03 +01:00
|
|
|
|
2022-02-17 19:22:17 +01:00
|
|
|
predictions_for_asset = pd.concat(
|
|
|
|
|
[preds[asset_name] for preds in all_predictions], axis=1
|
|
|
|
|
)
|
2022-01-09 20:00:03 +01:00
|
|
|
correlations[asset_name] = predictions_for_asset.corr().mean()[0]
|
|
|
|
|
print("Correlation for asset ", asset_name, ": ", correlations[asset_name])
|
|
|
|
|
|
|
|
|
|
correlations["Overall"] = correlations.mean()
|
|
|
|
|
print("Average correlation across all assests: ", correlations.mean())
|
|
|
|
|
|
|
|
|
|
correlations.to_csv("output/correlations.csv")
|