srizdebnath/tigergraphskills/algo-knn
Claude Code and agent skill by srizdebnath/tigergraphskills
- community
Checking that the SKILL.md file is still in the repository.
Install and run the k-Nearest Neighbors (kNN) classification algorithm. Use when classifying vertices based on proximity to labeled neighbors.
Install
npx vskill@latest install srizdebnath/tigergraphskills/algo-knnSKILL.md
The same SKILL.md was published earlier as srizdebnath/tigergraphskills/algo-knn.
Running k-Nearest Neighbors (kNN)
When to use this
Use when predicting the category or class of unlabeled vertices based on similarity scores to nearby labeled vertices.
Prerequisites
TigerGraph GSQL Algorithm Library installed. Links:
Steps
- Compile the kNN classification query.
- Execute the query passing the target vertex and labels:
``gsql RUN QUERY tg_knn_classification(source_vertex="User1", v_type="User", e_type="friend", label_attr="category", k=5, print_accum=TRUE, file_path="") ``
- The algorithm evaluates the top k nearest neighbors and assigns the majority label.
Common mistakes
- Selecting an even value for k when classifying binary groups, which can lead to tie votes. Use odd numbers for k.
- Not handling cases where the source vertex has fewer than k neighbors total.
Sources
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/algo-knn/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/srizdebnath/tigergraphskills/algo-knn)