Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Least Squares Regression

ASecurity

Use when you must fit a straight line to paired measurements by ordinary least squares: compute the slope and intercept of the best fit, the residual standard deviation, and the coefficient of determination, and predict the response at a new input. Produces the fit coefficients, the goodness of fit, and the residual scatter that gate whether the linear model is adequate for the analysis. Trigger: least squares, linear regression, best fit line, slope, intercept, residual standard deviation, c...

2 stars
0 votes
0 copies
0 views
Added 9/27/2026
ai-agentspythongo

Works with

claude code

Security Analysis

A100/100

Scanned 9/27/2026

Install to Claude Code

$npx -y skills add ashfordeOU/aero-agent-skills --skill least-squares-regression --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Least Squares Regression?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Least Squares Regression
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ashfordeou-least-squares-regression/badge)](https://www.skillsdirectory.com/skills/ashfordeou-least-squares-regression)

More formats (shields.io, HTML) on the badges page.

Download with Pro
Files
SKILL.md
---
name: least-squares-regression
description: "Use when you must fit a straight line to paired measurements by ordinary least squares: compute the slope and intercept of the best fit, the residual standard deviation, and the coefficient of determination, and predict the response at a new input. Produces the fit coefficients, the goodness of fit, and the residual scatter that gate whether the linear model is adequate for the analysis. Trigger: least squares, linear regression, best fit line, slope, intercept, residual standard deviation, coefficient of determination, r squared, prediction."
license: Apache-2.0
compliance: STANDARDS-REF
standards:
  - id: naca-tr-824
    reference-only: true
gated: false
domain: cross-cutting
pack: cross-cutting
compatibility: "agentskills.io SKILL.md; any SKILL.md host (Claude Code, Hermes, OpenClaw)"
metadata:
  domain: cross-cutting
  subdomain: numerics
  tags: [least-squares-regression, linear-regression, best-fit-line, slope, intercept, residual-standard-deviation, coefficient-of-determination, r-squared, prediction, goodness-of-fit]
  version: 0.1.0
  author: Aero Agent Skills
---
# Least Squares Regression (cross-cutting/numerics/least-squares-regression)

Use when the task is fitting a straight line to paired measurements by
ordinary least squares: slope and intercept, residual standard
deviation, coefficient of determination, and prediction at a new
input.

## Domain quick reference

- The fitted model is y = a + b*x with n paired samples (x_i, y_i),
  n >= 3 so the residual standard deviation has at least one degree
  of freedom.
- Slope b = Sxy / Sxx with Sxx = sum((x-xbar)**2) and
  Sxy = sum((x-xbar)*(y-ybar)); intercept a = ybar - b*xbar.
- Residuals r_i = y_i - (a + b*x_i) give SSE = sum(r_i**2); the
  residual standard deviation is s = sqrt(SSE / (n - 2)), with n - 2
  degrees of freedom for the two estimated parameters.
- Coefficient of determination r**2 = 1 - SSE / SST with
  SST = sum((y-ybar)**2), dimensionless in [0, 1].
- Prediction at a new input: y = a + b*x.

## Workflow

1. Collect the paired measurements (x, y).
2. Fit the line with linear_fit(xs, ys) -> (slope, intercept).
3. Quantify the scatter with residual_std(xs, ys, a, b).
4. Assess the model with r_squared(xs, ys, a, b).
5. Predict at a new input with predict(x, a, b); use fit_report for
   the one-shot summary before gating the analysis.

## Pitfalls

- Fitting with fewer than three points: the residual standard
  deviation needs at least one degree of freedom; the logic raises
  ValueError.
- Zero variance in x (Sxx == 0): the slope is undefined; the logic
  raises ValueError.
- Constant response (SST == 0): r**2 is undefined; the logic raises
  ValueError.
- Reporting s as the standard deviation of the data instead of the
  residual scatter around the fitted line: they are different
  quantities.
- Extrapolating far outside the sampled x range without saying so:
  the fit is only evidence inside the measured domain.

## Behavior contract (gate 3)

The fit, residual, and goodness-of-fit logic is exercised by the gate
3 contract test: scripts/test_least_squares.py against
scripts/least_squares_logic.py (stdlib unittest, offline). Run:

python3 scripts/test_least_squares.py

## Compliance

- NACA Report 824 is US government work (public domain); the pack
  anchor per standards-map.yaml. Least squares regression is generic
  numerical methodology, not RTCA or SAE content; summary and
  formulas only.
- compliance: STANDARDS-REF, gated: false.

Attribution

ashfordeOUashfordeOU
View sourceMore from ashfordeOU →
SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

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 (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Related Skills

Caveman

Ultra-compressed communication mode that cuts output tokens while keeping technical accuracy. Levels: lite, full, ultra and the wenyan variants. Use for /caveman, "caveman mode", "talk like caveman", "be brief" or "less tokens".

1074701 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

694821 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3351 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

691 votes

math-skill

A comprehensive mathematical reasoning skill for AI assistants — handles arithmetic to research-level problems with rigorous step-by-step reasoning, systematic verification, and transparent uncertainty handling

381 votes
View all in ai-agents →