skills/tabular/season-phase-labeling/SKILL.md
Map calendar dates to categorical season phases (offseason, preseason, regular, postseason) using np.select with boundary date conditions
npx skillsauth add wenmin-wu/ds-skills tabular-season-phase-labelingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Sports, retail, and event-driven datasets exhibit distinct behavioral regimes tied to calendar phases. Mapping each date to its season phase (offseason, preseason, regular season, postseason) creates a powerful categorical feature that captures regime-dependent patterns. Using np.select with ordered conditions and boundary dates handles complex multi-phase calendars cleanly.
import numpy as np
conditions = [
df["date"] < df["preseason_start"],
df["date"] < df["regular_start"],
df["date"] <= df["regular_end"],
df["date"] < df["postseason_start"],
df["date"] <= df["postseason_end"],
df["date"] > df["postseason_end"],
]
labels = ["offseason", "preseason", "regular", "postseason_gap", "postseason", "offseason"]
df["season_phase"] = np.select(conditions, labels, default="unknown")
np.select evaluates top-to-bottom, first match winsdata-ai
Scaled Pinball Loss (SPL) metric for evaluating quantile forecasts, normalized by mean absolute successive differences of training data
data-ai
Walk backward through a time series and multiplicatively rescale segments when jumps exceed a fraction of the running mean to correct data collection anomalies
testing
Transform forecasting target to next/current ratio minus one so that optimizing MAE or squared error implicitly minimizes SMAPE
tools
Convert point forecasts to prediction intervals by scaling with logit-transformed quantile ratios passed through a Normal CDF