wenmin-wu/ds-skills/haversine-knn-candidate-generation
Claude Code and agent skill by wenmin-wu/ds-skills
- community
Checking that the SKILL.md file is still in the repository.
Generates geographically proximate candidate pairs for entity matching using KNN with haversine distance, optionally partitioned by country.
Install
npx vskill@latest install wenmin-wu/ds-skills/haversine-knn-candidate-generationSKILL.md
Haversine KNN Candidate Generation
Overview
Entity matching at scale requires a candidate generation step — comparing all N^2 pairs is infeasible. For location-based entities (POIs, stores, addresses), KNN with haversine distance finds the K geographically closest candidates per record. Partitioning by country/region reduces the search space further and prevents cross-continent false matches. The resulting candidate pairs are then scored by a downstream classifier.
Quick Start
Workflow
- Convert lat/lon to radians (required by haversine metric)
- Partition data by country or region to reduce search space
- Fit KNN with haversine metric per partition
- Extract K nearest neighbors and distances for each record
- Build candidate pair DataFrame with distance and rank features
Key Decisions
- n_neighbors: 10-50 typical; higher recall but more pairs to classify
- Partitioning: By country prevents cross-region false matches; skip for global matching
- Distance unit: Haversine returns radians; multiply by 6371 for kilometers
- Dual index: Combine geo KNN with text-based KNN for higher recall
References
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/tabular/haversine-knn-candidate-generation/SKILL.md
Popularity
- Repository stars
- 51
- Repository forks
- 4
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. 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/wenmin-wu/ds-skills/haversine-knn-candidate-generation)