Agent skill

Algo Rec Mf

by asgard-ai-platform in asgard-ai-platform/skills

Implement matrix factorization to decompose user-item interaction matrices into latent factor representations.

MITAuto-check passed

Install Algo Rec Mf

skills CLI
$ npx skills add asgard-ai-platform/skills --skill algo-rec-mf -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install asgard-ai-platform/skills algo-rec-mf --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/asgard-ai-platform/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/algo-rec-mf .claude/skills/algo-rec-mf && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
algo-rec-mf
GitHub stars
242
Token cost
~1.1k tokens
SKILL.md length
403 words
Files
4 (incl. references)
Skills in repo
207
Repo updated
First seen
Licence
MIT

At a glance

Implement matrix factorization to decompose user-item interaction matrices into latent factor representations.

  • Works in 4 steps: Input Validation → Core Algorithm → Verification → …
  • The user needs scalable collaborative filtering
  • SKILL.md covers Overview, When to Use, Algorithm and Output Format, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Algo Rec Mf is an agent skill from asgard-ai-platform/skills. Implement matrix factorization to decompose user-item interaction matrices into latent factor representations. Use this skill when the user needs scalable collaborative filtering, latent feature discovery, or dimensionality reduction for recommendation — even if they say 'SVD recommendations', 'latent factors', or 'factorize the rating matrix'.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `examples/sample_scenario.md`, `references/implicit-mf.md` and `references/optimization-comparison.md`).

The repository describes itself as: 301 open-source coding agent skills across 22 domains — methodology, judgment & gotchas packaged as Claude Agent Skills for the Asgard AI Platform. The licence is MIT.

When your agent uses it

  • The user needs scalable collaborative filtering
  • Latent feature discovery
  • Dimensionality reduction for recommendation — even if they say SVD recommendations
  • Factorize the rating matrix

Example prompts

  • “SVD recommendations”
  • “latent factors”
  • “factorize the rating matrix”
  • “/algo-rec-mf”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Input Validation
  2. Core Algorithm
  3. Verification
  4. Output

What it can do on your machine

Read from SKILL.md and the folder at commit 4e7f4f8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are json).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Algo Rec Mf loads about 1.1k tokens when it runs, and up to ~6.2k if it reads all its reference files. Until then it costs about 90 tokens; SKILL.md has 403 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~90
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from asgard-ai-platform/skills at commit 4e7f4f8, republished under its MIT licence (© asgard-ai-platform). 403 words, ~1,080 tokens.

Download SKILL.mdSave it as .claude/skills/algo-rec-mf/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
algo-rec-mf
description
Implement matrix factorization to decompose user-item interaction matrices into latent factor representations. Use this skill when the user needs scalable collaborative filtering, latent feature discovery, or dimensionality reduction for recommendation — even if they say 'SVD recommendations', 'latent factors', or 'factorize the rating matrix'.
metadata.category
WP-36 推薦系統
metadata.tags
recommendation, matrix-factorization, svd, latent-factors

Matrix Factorization

Overview

Matrix factorization decomposes the user-item interaction matrix R (m×n) into two low-rank matrices: U (m×k) and V (n×k), where k << min(m,n). Predicted rating: r̂ᵢⱼ = uᵢ · vⱼ. Trains in O(k × nnz × iterations) where nnz = non-zero entries.

When to Use

Trigger conditions:

  • Scaling CF beyond pairwise similarity (millions of users/items)
  • Discovering latent factors that explain user-item interactions
  • Predicting ratings for unobserved user-item pairs

When NOT to use:

  • When interaction data is extremely sparse (< 0.1% fill) — insufficient for learning
  • When you need real-time updates (retraining is expensive)

Algorithm

IRON LAW: Rank k Controls Bias-Variance Trade-Off
- Too LOW k: underfits, misses nuanced preferences (high bias)
- Too HIGH k: overfits to noise, poor generalization (high variance)
- Typical k: 20-200. Select via cross-validation on held-out ratings.
- Always add regularization (λ) to prevent overfitting.
Phase 1: Input Validation

Load sparse interaction matrix. Split into train/validation/test. Check minimum density. Gate: Train matrix has sufficient entries per user and item.

Phase 2: Core Algorithm

ALS (Alternating Least Squares):

  1. Initialize U, V randomly (or with SVD warm-start)
  2. Fix V, solve for U: minimize ||R - UV^T||² + λ(||U||² + ||V||²)
  3. Fix U, solve for V using same objective
  4. Alternate until convergence (RMSE change < ε)

SGD alternative: Update u_i, v_j incrementally for each observed rating using gradient descent.

Phase 3: Verification

Compute RMSE on held-out validation set. Compare against baseline (global mean, user mean). Gate: Validation RMSE significantly below baseline.

Phase 4: Output

Return top-N predictions per user with predicted scores.

Output Format

json
{
  "recommendations": [{"user_id": "u1", "items": [{"item_id": "i5", "predicted_rating": 4.3}]}],
  "metadata": {"rank_k": 50, "regularization": 0.01, "iterations": 20, "train_rmse": 0.82, "val_rmse": 0.91}
}

Examples

Sample I/O

Input: 3×3 rating matrix R (0 = unobserved), k=1

R = [[5, 3, 0],
     [4, 0, 2],
     [0, 1, 1]]

Expected: After ALS with k=1 (one latent factor, λ=0.01, 50 iterations), approximate factorization:

U ≈ [[2.24], [1.84], [0.53]]
V ≈ [[2.23], [1.06], [0.98]]
R_hat ≈ [[4.99, 2.37, 2.20],
         [4.10, 1.95, 1.80],
         [1.18, 0.56, 0.52]]

Verify: R_hat ≈ R on observed entries (within 0.2 RMSE). U[0] >> U[2] correctly captures user 0's higher ratings.

Show full SKILL.md (158 more words)Show less
Edge Cases
InputExpectedWhy
User with 1 ratingPoor predictions for that userInsufficient data to learn user factors
Highly popular itemPredicted near averageDominant first latent factor captures popularity
All ratings = 5Trivial factorizationNo variance to learn from

Gotchas

  • Implicit data needs different loss: For clicks/views (no explicit ratings), use weighted matrix factorization (Hu et al. 2008) with confidence weighting, not RMSE.
  • Cold start remains: New users/items have no entries in R. MF can't factorize what doesn't exist. Use side features or hybrid approaches.
  • Negative sampling: For implicit feedback, you must sample negative examples (unobserved ≠ disliked). Random negative sampling works but biased sampling is better.
  • Initialization matters: Random initialization can converge to poor local optima. SVD-based warm-start often helps.
  • Bias terms: Add user bias bᵢ and item bias bⱼ: r̂ᵢⱼ = μ + bᵢ + bⱼ + uᵢ·vⱼ. This captures systematic rating tendencies.

References

  • For ALS vs SGD comparison, see references/optimization-comparison.md
  • For implicit feedback matrix factorization, see references/implicit-mf.md

© asgard-ai-platform, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in algo-rec-mf of asgard-ai-platform/skills.

  • SKILL.md
  • examples/sample_scenario.md
  • references/implicit-mf.md
  • references/optimization-comparison.md

Open the folder on GitHubat commit 4e7f4f8

Compare with similar skills

Algo Rec Mf next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Algo Rec Mf compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Algo Rec Mf this skillasgard-ai-platform/skills242—~1.1kAutomated safety check: PassMIT
Matrixbergside/awesome-design-skills3.1k1 repos~957Automated safety check: PassMIT
Agent Matrix Optimizerruvnet/ruflo74k2 repos~1.8kAutomated safety check: PassMIT
Remotion Interactivityremotion-dev/remotion63k5 repos~4.8kAutomated safety check: PassCustom licence
Firecrawl Interact Integrationfirecrawl/firecrawl190k1 repos~731Automated safety check: PassISC
Tech Matrixsickn33/agentic-awesome-skills47k1 repos~3.1kAutomated safety check: PassMIT

Similar skills

  • Matrix

    bergside/awesome-design-skills

    A cyber-slick, dark-only Matrix-inspired interface defined by minimalist fashion, high-tech digital elements

    3.1k GitHub starsUsed in 1 repo~957 tokens
    Frontend & DesignAuto-check passed
  • Agent skill for matrix-optimizer - invoke with $agent-matrix-optimizer

    74k GitHub starsUsed in 2 repos~1.8k tokens
    Auto-check passed
  • Remotion Interactivity

    remotion-dev/remotion

    Official

    Structure Remotion markup for interactivity. An agent skill from remotion-dev/remotion.

    63k GitHub starsUsed in 5 repos~4.8k tokens
    Media & CreativeAuto-check passed
  • Guides adding Firecrawl's /interact endpoint to product code for pages that need clicks, forms, pagination or logged-in flows beyond plain scraping.

    190k GitHub starsUsed in 1 repo~731 tokens
    Data & AnalyticsAuto-check passed
  • Tech Matrix

    sickn33/agentic-awesome-skills

    Reference document for monopoly tech-matrix. An agent skill from sickn33/agentic-awesome-skills.

    47k GitHub starsUsed in 1 repo~3.1k tokens
    Backend & APIsAuto-check passed
  • Competency Matrix

    sickn33/agentic-awesome-skills

    Competency matrix of expected proficiency by job title and grade, with assessment method and linked skill area.

    47k GitHub starsUsed in 1 repo~3.7k tokens
    Auto-check passed

More from asgard-ai-platform/skills

All 207 skills in this repo
  • Algo Ecom Bm25

    asgard-ai-platform/skills

    Implement BM25 ranking function for e-commerce product search relevance scoring.

    242 GitHub stars~1.4k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Mfg Cpk

    asgard-ai-platform/skills

    Calculate Cpk process capability index to assess whether a process meets specification requirements.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Price Elasticity

    asgard-ai-platform/skills

    Calculate price elasticity of demand to quantify how price changes affect sales volume.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Rank Bayesian

    asgard-ai-platform/skills

    Apply Bayesian averaging to rank items by combining observed ratings with prior expectations.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Rank Elo

    asgard-ai-platform/skills

    Implement Elo rating system to rank items or players from pairwise comparison outcomes.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Algo Rank Wilson

    asgard-ai-platform/skills

    Calculate Wilson Score confidence intervals for ranking items by positive proportion with sample size correction.

    242 GitHub stars~1.1k tokensUpdated 4 mo ago
    Auto-check passed

Questions about Algo Rec Mf

What does Algo Rec Mf do?

Implement matrix factorization to decompose user-item interaction matrices into latent factor representations. Algo Rec Mf is an agent skill from asgard-ai-platform/skills. Implement matrix factorization to decompose user-item interaction matrices into latent factor representations.

When should I use Algo Rec Mf?

Algo Rec Mf fits situations like: the user needs scalable collaborative filtering; latent feature discovery; dimensionality reduction for recommendation — even if they say SVD recommendations; factorize the rating matrix.

How do I install Algo Rec Mf in Claude Code?

Run `npx skills add asgard-ai-platform/skills --skill algo-rec-mf -a claude-code`. Or copy the skill folder (algo-rec-mf in asgard-ai-platform/skills) into .claude/skills/algo-rec-mf in your project. Claude Code loads it when a task matches its description.

How do I install Algo Rec Mf in Codex?

Run `npx skills add asgard-ai-platform/skills --skill algo-rec-mf -a codex`. Or copy the skill folder (algo-rec-mf in asgard-ai-platform/skills) into .agents/skills/algo-rec-mf in your project. Codex loads it when a task matches its description.

Can I use Algo Rec Mf in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add asgard-ai-platform/skills --skill algo-rec-mf -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/algo-rec-mf, .gemini/skills/algo-rec-mf, .github/skills/algo-rec-mf and .opencode/skills/algo-rec-mf in your project.

What does Algo Rec Mf need to run?

SKILL.md names no scripts, command-line tools or credentials: Algo Rec Mf is instructions for the agent only.

Does Algo Rec Mf access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Algo Rec Mf safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Algo Rec Mf use?

Algo Rec Mf is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Algo Rec Mf use?

About 1.1k tokens (SKILL.md is roughly 4.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.1k tokens, read only when the agent opens those files.

What are the alternatives to Algo Rec Mf?

Skills that share tags, products or a category with Algo Rec Mf: Matrix (bergside/awesome-design-skills, 3.1k stars), Agent Matrix Optimizer (ruvnet/ruflo, 74k stars), Remotion Interactivity (remotion-dev/remotion, 63k stars) and Firecrawl Interact Integration (firecrawl/firecrawl, 190k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Algo Rec Mf?

asgard-ai-platform (a GitHub organization) maintains it in asgard-ai-platform/skills, which has 242 GitHub stars. The repository holds 207 skills in this directory. The repository was last updated on June 6, 2026.

Source: asgard-ai-platform/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.