Skip to content

Ensemble aggregator#53

Merged
smellycloud merged 10 commits intodevelopmentfrom
ensemble_aggregator
Jan 27, 2026
Merged

Ensemble aggregator#53
smellycloud merged 10 commits intodevelopmentfrom
ensemble_aggregator

Conversation

@lujzi05
Copy link
Collaborator

@lujzi05 lujzi05 commented Dec 10, 2025

No description provided.

@lujzi05 lujzi05 requested a review from xiaolong0728 December 10, 2025 10:34

def __init__(
self,
index_cols: List[str] = ["time", "entity_id"],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standardizes index names to ["time", "entity_id"] by default, but the CMDataset/PGMDataset handlers use month_id/country_id or month_id/priogrid_id.

first_df = next(iter(df_to_aggregate.values()))
index_cols = list(first_df.index.names)
#target_cols = [c for c in first_df.columns if c not in index_cols] ### This is not right, but how to chose target cols?
target_cols = [c for c in first_df.columns if c not in index_cols]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For predictions, only columns like pred_* or specific target columns should be aggregated, not all non-index columns. This could accidentally aggregate metadata columns. Use self.configs["targets"] for actual target columns.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

for i in range(len(dfs[0])):
df_to_aggregate = [df[i] for df in dfs]
for i in range(len(n_outputs)):
model_dfs_i = {model_name: dfs[i] for model_name, dfs in eval_results.items()}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If any model returns fewer DataFrames than expected, this will raise an IndexError without a helpful error message.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added explicit error message

@smellycloud smellycloud merged commit 45b8cea into development Jan 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants