skills/timeseries/multiband-color-index-features/SKILL.md
Compute log-ratio features between adjacent frequency bands as color indices to characterize spectral shape from multi-band time series
npx skillsauth add wenmin-wu/ds-skills timeseries-multiband-color-index-featuresInstall 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.
For multi-band time series (multiple sensor channels or frequency bands), compute "color indices" — the log-ratio of mean values between adjacent bands. In astronomy, color = -2.5*log10(flux_A/flux_B) captures the spectral energy distribution. In general, cross-band ratios expose relative signal strength across channels, which is more discriminative than per-band statistics alone.
import numpy as np
def color_index_features(df, id_col, band_col, value_col, band_order):
"""Compute color indices between adjacent bands.
Args:
df: DataFrame with multi-band time series
id_col: entity identifier column
band_col: band/channel identifier column
value_col: measurement value column
band_order: list of band names in spectral order
"""
# Mean value per band per entity
band_means = df.groupby([id_col, band_col])[value_col].mean().unstack()
features = {}
for i in range(len(band_order) - 1):
b1, b2 = band_order[i], band_order[i + 1]
col_name = f'color_{b1}_minus_{b2}'
ratio = band_means[b1] / band_means[b2]
# Log-ratio (color index); handle non-positive values
features[col_name] = -2.5 * np.log10(ratio.clip(lower=1e-10))
return pd.DataFrame(features)
data-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