# Cardiac Arrhythmia Detection Eval

> Evaluates binary classification of ECG heartbeat signals into normal versus abnormal categories. Probes the effectiveness of feature extraction and optimization pipelines for medical signal processing. Use when the user wants to benchmark on MIT-BIH Arrhythmia database (subset), or asks about evaluating this task. Reports accuracy.

- Skill: `qhjqhj00/cardiac-arrhythmia-detection-eval` (Agent Skill)
- Install (CLI): `npx skillmds add qhjqhj00/cardiac-arrhythmia-detection-eval`
- Raw SKILL.md: https://api.skillmd.com/api/skills/qhjqhj00/cardiac-arrhythmia-detection-eval/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: qhjqhj00 (https://skillmd.com/u/qhjqhj00)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/qhjqhj00/cardiac-arrhythmia-detection-eval

---


# cardiac-arrhythmia-detection-eval

> Combining Support Vector Machine and Elephant Herding Optimization for Cardiac Arrhythmias — Hassanien et al. (2018) (arXiv:1806.08242, 2018)

## What this evaluates

Evaluates binary classification of ECG heartbeat signals into normal versus abnormal categories. Probes the effectiveness of feature extraction and optimization pipelines for medical signal processing.

## Datasets

- **MIT-BIH Arrhythmia database (subset)** — total 25210; splits: cross-validation (-1)

## Metrics

- `accuracy` **(primary)** — range: percent
  - TP + TN / (TP + FP + FN + TN) * 100
- `precision` — range: percent
  - TP / (TP + FP) * 100
- `sensitivity` — range: percent
  - TP / (TP + FN) * 100
- `f-measure` — range: percent
  - 2 * (PPV * TPR) / (PPV + TPR) * 100
- `specificity` — range: percent
  - TN / (TN + FP) * 100

## Input / output format

**Input**: 10-dimensional feature vectors extracted from ECG heartbeat signals for 10 patients.

**Output**: Binary label: Normal (N) or Abnormal (A).

## Scoring recipe

```python
def compute_metrics(y_true, y_pred):
    tp = sum(1 for t, p in zip(y_true, y_pred) if t == 'A' and p == 'A')
    tn = sum(1 for t, p in zip(y_true, y_pred) if t == 'N' and p == 'N')
    fp = sum(1 for t, p in zip(y_true, y_pred) if t == 'N' and p == 'A')
    fn = sum(1 for t, p in zip(y_true, y_pred) if t == 'A' and p == 'N')
    acc = (tp + tn) / (tp + fp + fn + tn) * 100
    prec = tp / (tp + fp) * 100 if (tp + fp) > 0 else 0
    se = tp / (tp + fn) * 100 if (tp + fn) > 0 else 0
    sp = tn / (tn + fp) * 100 if (tn + fp) > 0 else 0
    f = 2 * (prec * se) / (prec + se) * 100 if (prec + se) > 0 else 0
    return acc, prec, se, f, sp
```

## Common pitfalls

- Dataset is a restricted subset (10 patients, 16 beat types collapsed to 2 classes), not the full 48-record MIT-BIH database.
- Evaluation uses 3-fold leave-one-out cross-validation rather than a fixed train/test split, making direct comparison with standard splits difficult.
- Metrics are explicitly calculated as percentages (0–100) rather than decimals (0–1), which may cause scaling errors in automated pipelines.

## Evidence (verbatim from paper)

> Five standard criteria are used to evaluate the proposed approach: 1) accuracy (Acc), 2) precision (Prec), (3) specificity (Sp), (4) F-measure (F), and (5) sensitivity (Se). Performance measures generally depend on four main metrics of a binary classification result (positive/negative/true/false). Mathematically, the performance measures are defined by the following Equations. Accuracy (Acc): Acc = (TP + TN) / (TP + FP + FN + TN) * 100

## Citation

```bibtex
@misc{hassanien2018combining,
  title={Combining Support Vector Machine and Elephant Herding Optimization for Cardiac Arrhythmias},
  author={Hassanien et al. (2018)},
  year={2018},
  note={arXiv:1806.08242}
}
```

- arXiv: 1806.08242

