Skip to content
Back to skills

Sensor Phase Visualization

ASecurity

EDA visualization of multi-modal sensor data with axvspan shading for labeled behavioral phases and contiguous span detection

  • 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 sensor-phase-visualization --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sensor Phase Visualization?

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

Security grade badge for Sensor Phase Visualization
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/wenmin-wu-sensor-phase-visualization/badge)](https://www.skillsdirectory.com/skills/wenmin-wu-sensor-phase-visualization)

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: timeseries-sensor-phase-visualization
description: EDA visualization of multi-modal sensor data with axvspan shading for labeled behavioral phases and contiguous span detection
domain: timeseries
---

# Sensor Phase Visualization

## Overview

For labeled time-series data with behavioral phases (gesture, transition, activity), visualize multi-modal sensor signals with color-shaded phase regions. Detects contiguous spans from phase labels using index-diff grouping, and overlays them on sensor plots. Essential EDA for understanding sensor-behavior relationships.

## Quick Start

```python
import numpy as np
import matplotlib.pyplot as plt

def shade_phases(ax, timestamps, phase_labels, phase_colors):
    """Overlay colored regions for each behavioral phase.
    
    Args:
        ax: matplotlib axis
        timestamps: array of time values
        phase_labels: array of phase strings per timestep
        phase_colors: dict mapping phase name → color
    """
    for phase, color in phase_colors.items():
        mask = phase_labels == phase
        if not mask.any():
            continue
        indices = np.where(mask)[0]
        # Group contiguous indices into spans
        breaks = np.where(np.diff(indices) != 1)[0]
        spans = np.split(indices, breaks + 1)
        for span in spans:
            t0, t1 = timestamps[span[0]], timestamps[span[-1]]
            ax.axvspan(t0, t1, color=color, alpha=0.25, label=None)

# Usage
fig, axes = plt.subplots(3, 1, figsize=(14, 8), sharex=True)
phases = {"Gesture": "salmon", "Transition": "lightgray"}
for ax, (name, cols) in zip(axes, sensor_groups.items()):
    ax.plot(df['time'], df[cols])
    shade_phases(ax, df['time'].values, df['phase'].values, phases)
    ax.set_ylabel(name)
```

## Key Decisions

- **Contiguous span detection**: `np.diff(indices) != 1` finds boundaries between non-adjacent labeled regions
- **alpha=0.25**: transparent enough to see signals underneath
- **sharex**: synchronized zoom across modalities for correlation analysis

## References

- Source: [sensor-pulse-viz-eda-for-bfrb-detection](https://www.kaggle.com/code/tarundirector/sensor-pulse-viz-eda-for-bfrb-detection)
- Competition: CMI - Detect Behavior with Sensor Data

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.