Loading...
Loading...
Implement collaborative filtering for recommendations based on user behavior patterns. Use this skill when the user needs to build a recommendation engine from user-item interaction data, find similar users or items, or predict ratings — even if they say 'users who bought this also bought', 'similar users', or 'recommend based on behavior'.
npx skill4agent add asgard-ai-platform/skills algo-rec-cfIRON LAW: CF Requires SUFFICIENT Interaction Data
With sparse matrices (< 1% fill rate), similarity computation is
unreliable. Minimum viable: each user has rated 5+ items, each item
has 5+ ratings. Below this, fallback to content-based or popularity.{
"recommendations": [{"item_id": "123", "predicted_score": 4.2, "similar_items_used": 5}],
"metadata": {"method": "item-based", "similarity": "cosine", "k_neighbors": 20, "sparsity": 0.97}
}| Input | Expected | Why |
|---|---|---|
| New user, no ratings | Cannot recommend | Cold start — fallback to popularity |
| Item rated by all users | Low differentiation | High popularity ≠ personalized match |
| Single shared item | Unreliable similarity | Need multiple co-ratings for stable similarity |
references/matrix-factorization.mdreferences/implicit-feedback.md