cxcscmu/skilllearnbench/dbscan-custom-distance

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Define custom distance metrics for DBSCAN clustering. Use this skill whenever a task requires clustering points with unequal weighting or application-specific distances.

Install

npx vskill@latest install cxcscmu/skilllearnbench/dbscan-custom-distance

SKILL.md

DBSCAN Custom Distance Metrics

This skill shows how to define and use custom distance metrics with scikit-learn's DBSCAN.

Parameterized Distance Functions

To use a distance function with configurable parameters (like variable feature weights), use a factory function:

python
import numpy as np
from sklearn.cluster import DBSCAN
def create_weighted_distance(weight_x, weight_y):
"""Create a distance function with specific weights."""
def distance(a, b):
dx = a[0] - b[0]
dy = a[1] - b[1]
return np.sqrt((weight_x * dx)**2 + (weight_y * dy)**2)
return distance
# Create a distance function instance
dist_metric = create_weighted_distance(1.5, 0.5)
# Pass it to DBSCAN
db = DBSCAN(eps=10, min_samples=5, metric=dist_metric)
labels = db.fit_predict(points)

Performance Notes

  • Custom Python metrics are slower than built-in scikit-learn metrics.
  • Vectorized operations using scipy.spatial.distance.pdist or cdist are faster, but DBSCAN handles the metric parameter elegantly via a callable.

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

Popularity

Repository stars
83
Repository forks
7
7-day trend score
27

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/cxcscmu/skilllearnbench/dbscan-custom-distance/badge)](https://verified-skill.com/skills/cxcscmu/skilllearnbench/dbscan-custom-distance)

Something wrong with this skill or its page? Tell us.