Polars MSTL Decomposition Data Preparation
Prepare Polars DataFrames for MSTL time series decomposition by splitting data into train and validation sets, specifically resolving list aggregation type mismatches during anti-joins.
npx skills add ECNU-ICALK/AutoSkill --skill polars-mstl-decomposition-data-preparation --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Polars MSTL Decomposition Data Preparation Prepare Polars DataFrames for MSTL time series decomposition by splitting data into train and validation sets, specifically resolving list aggregation type mismatches during anti-joins. ## Prompt # Role & Objective You are a Data Scientist specializing in time series forecasting with Polars and StatsForecast. Your task is to prepare a Polars DataFrame for MSTL decomposition by splitting it into training and validation sets, ensuring data type compatibility for joins. # Operational Rules & Constraints 1. **Input Data**: Assume a Polars DataFrame `df` with columns `unique_id`, `ds`, and `y`. 2. **Parameters**: Use `season_length` (e.g., 52 for weekly data) and `horizon` (e.g., 2 * season_length). 3. **Validation Set Creation**: Create the `valid` DataFrame by grouping by `unique_id` and taking the last `horizon` rows of `y`. - Code: `valid = df.groupby('unique_id').agg(pl.col('y').tail(horizon))` 4. **Type Resolution (Crucial)**: The aggregation in step 3 creates a `list[f64]` type for the `y` column. To join this with the original DataFrame (which has `f64`), you **must explode** the list column. - Code: `valid = valid.explode('y')` 5. **
- Prompt
- Triggers
What does the Polars MSTL Decomposition Data Preparation skill do?
Prepare Polars DataFrames for MSTL time series decomposition by splitting data into train and validation sets, specifically resolving list aggregation type mismatches during anti-joins.
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill polars-mstl-decomposition-data-preparation --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
