Skip to content
Back to skills

Row Aggregate Features

ASecurity

Engineers row-wise statistical features (sum, mean, std, skew, kurtosis, median, min, max) across all numeric columns per sample.

  • 61 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 12, 2026
datapython

Security analysis

A100/100

Scanned September 12, 2026

npx -y skills add wenmin-wu/ds-skills --skill row-aggregate-features --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Row Aggregate Features?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Row Aggregate Features
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/wenmin-wu-row-aggregate-features/badge)](https://www.skillsdirectory.com/skills/wenmin-wu-row-aggregate-features)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: tabular-row-aggregate-features
description: >
  Engineers row-wise statistical features (sum, mean, std, skew, kurtosis, median, min, max) across all numeric columns per sample.
---
# Row Aggregate Features

## Overview

When a dataset has many anonymous or homogeneous numeric columns (e.g., 200 `var_0` to `var_199`), row-level aggregates summarize each sample's overall distribution. Tree models can use these to split on "samples with high variance" or "samples with extreme values" — patterns invisible to individual features.

## Quick Start

```python
import pandas as pd

feature_cols = [c for c in df.columns if c.startswith("var_")]

df["row_sum"]  = df[feature_cols].sum(axis=1)
df["row_mean"] = df[feature_cols].mean(axis=1)
df["row_std"]  = df[feature_cols].std(axis=1)
df["row_min"]  = df[feature_cols].min(axis=1)
df["row_max"]  = df[feature_cols].max(axis=1)
df["row_skew"] = df[feature_cols].skew(axis=1)
df["row_kurt"] = df[feature_cols].kurtosis(axis=1)
df["row_med"]  = df[feature_cols].median(axis=1)
```

## Workflow

1. Identify the block of homogeneous numeric columns
2. Compute row-wise statistics across those columns
3. Add as new features alongside the originals
4. Apply to both train and test identically
5. Let the model decide which aggregates are informative

## Key Decisions

- **Which stats**: Start with mean, std, min, max; add skew/kurtosis if the model benefits
- **Subsets**: Compute over all features or meaningful subgroups (top-importance, positive-only)
- **Percentiles**: `np.percentile(row, [25, 75])` can capture spread better than min/max
- **Nulls**: Use `skipna=True` (default) to handle missing values gracefully

## References

- [Santander EDA and Prediction](https://www.kaggle.com/code/gpreda/santander-eda-and-prediction)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.