Skip to content
Back to skills

Multi Label Mapping

ASecurity

Construct and apply BAR multi-label mappings that average groups of source-model probabilities into target-label probabilities.

  • 247 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 9, 2026
developmentpythongit

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill multi_label_mapping --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Multi Label Mapping?

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

Security grade badge for Multi Label Mapping
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-multi-label-mapping/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-multi-label-mapping)

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

SKILL.md
---
name: multi_label_mapping
description: Construct and apply BAR multi-label mappings that average groups of source-model probabilities into target-label probabilities.
---

# Multi-label Mapping

Use this skill when a source classifier has a different label space from the target task and BAR-style adversarial reprogramming needs a deterministic mapping from source labels to target labels.

Do not use it when the source model already exposes the target label space directly.

## Inputs

- Source confidence rows or logits for each sample.
- Integer target labels.
- Number of source labels assigned to each target label.
- Optional frequency-based construction mode.

## Outputs

- Mapping `{target_label: [source_label_indices]}`.
- Mapped target probabilities computed by averaging source probabilities in each group.

## Workflow

1. Normalize each source output row if it is not already a probability vector.
2. For fixed mappings, validate non-empty non-overlapping source groups.
3. For frequency mapping, rank source labels by class-conditioned mean confidence and greedily assign unused labels to target classes.
4. Compute each target probability as the average of its mapped source probabilities.
5. Renormalize mapped probabilities before focal or cross-entropy loss if required.

## Validation

Run `python tests/test_multi_label_mapping.py` or `validate_skill_tree.py --run-tests`.

## Limitations

The paper used ImageNet-scale label spaces. This skill provides the reusable mapping logic and deterministic reduced-test behavior; it does not provide a pretrained source classifier.

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…