Skip to content
Back to skills

Sigmoid Normalized Rmse

ASecurity

Sigmoid-transformed normalized RMSE that maps error from [0,inf) to a bounded (0,1] similarity score using R2-score ratio

  • 61 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 12, 2026
toolspython

Security analysis

A100/100

Scanned September 12, 2026

npx -y skills add wenmin-wu/ds-skills --skill sigmoid-normalized-rmse --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sigmoid Normalized Rmse?

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

Security grade badge for Sigmoid Normalized Rmse
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/wenmin-wu-sigmoid-normalized-rmse/badge)](https://www.skillsdirectory.com/skills/wenmin-wu-sigmoid-normalized-rmse)

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: cv-sigmoid-normalized-rmse
description: Sigmoid-transformed normalized RMSE that maps error from [0,inf) to a bounded (0,1] similarity score using R2-score ratio
---

# Sigmoid Normalized RMSE

## Overview

Standard RMSE is unbounded and hard to interpret across different scales. Normalize RMSE by dividing by the baseline error (predicting the mean), then apply a sigmoid transform `2 - 2/(1+exp(-x))` to map the result to (0, 1]. Perfect predictions score 1.0, predictions at baseline quality score ~0.63, and worse-than-baseline predictions approach 0. This creates a bounded, interpretable metric suitable for averaging across heterogeneous data series.

## Quick Start

```python
import numpy as np
from sklearn.metrics import r2_score

def sigmoid(x):
    return 2 - 2 / (1 + np.exp(-x))

def sigmoid_normalized_rmse(y_true, y_pred):
    r2 = r2_score(y_true, y_pred)
    normalized_error = max(0, (1 - r2)) ** 0.5
    return sigmoid(normalized_error)

y_true = [10, 20, 30, 40, 50]
y_pred = [12, 18, 33, 38, 52]
score = sigmoid_normalized_rmse(y_true, y_pred)  # ~0.89
```

## Workflow

1. Compute R2 score between predictions and ground truth
2. Convert to normalized error: `sqrt(max(0, 1 - R2))`
3. Apply sigmoid transform: `2 - 2/(1 + exp(-error))`
4. Result is in (0, 1] — higher is better

## Key Decisions

- **Why sigmoid**: bounds the metric to (0, 1], making it averageable across different scales
- **R2-based normalization**: divides by variance of true values, making it scale-invariant
- **sqrt(1-R2)**: equivalent to RMSE/std(y_true), the coefficient of variation of error
- **Use case**: comparing prediction quality across series with different magnitudes

## References

- [Competition Metric - Benetech Mixed-Match](https://www.kaggle.com/code/ryanholbrook/competition-metric-benetech-mixed-match)

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.