Skip to content
Back to skills

Linear Datamodel Fit

ASecurity

Fit target-specific linear datamodel surrogates from subset membership vectors to observed target outcomes.

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 9, 2026
ai-agentspythonbash

Security analysis

A100/100

Scanned September 9, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Linear Datamodel Fit?

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

Security grade badge for Linear Datamodel Fit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-linear-datamodel-fit/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-linear-datamodel-fit)

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

SKILL.md
---
name: linear_datamodel_fit
description: Fit target-specific linear datamodel surrogates from subset membership vectors to observed target outcomes.
---

# Linear Datamodel Fit

Use this skill after subset-output pairs are available for a fixed target example. It preserves the paper mechanism of predicting `f_A(x; S')` from the binary characteristic vector of `S'`.

## Inputs

- Binary membership matrix `X` with one row per sampled subset.
- Outcome vector `y` with one value per subset.
- Optional ridge value for stable underdetermined fits.

## Outputs

- Datamodel weights `theta`.
- Intercept.
- Predictions and diagnostics: Pearson correlation, MSE, and optional weight correlation.

## Workflow

1. Validate row counts and binary membership values.
2. Add an intercept column.
3. Solve least squares or ridge-regularized normal equations.
4. Evaluate on held-out subsets, not only the fitted rows.
5. Use learned weights as datamodel embeddings or pass them to counterfactual scoring.

## Validation

Run:

```bash
python scripts/fit_datamodel.py --demo
python tests/test_fit_datamodel.py
```

## Limitations

This skill fits the surrogate only; it does not create the base training subsets or train the original task model.

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.