agentsclimarketplace

Dbscan custom metric

Skill cxcscmu/SkillLearnBench/skills/b1-one-shot-gemini-3.1-flash-lite-preview/dbscan-parameter-tuning/dbscan-custom-metric

Implements DBSCAN with a weighted Euclidean distance metric.From its SKILL.md

Install
npx -y skills add cxcscmu/SkillLearnBench --skill dbscan-custom-metric

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

0.6 KB, 141 tokens by cl100k_base, as published. Nobody here has run it

Usage

Use this for clustering problems where directional features need attenuation.

import numpy as np
from sklearn.cluster import DBSCAN
from sklearn.metrics import pairwise_distances

def custom_distance(a, b, w):
    # d(a, b) = sqrt((w * Δx)² + ((2 - w) * Δy)²)
    dx = (a[0] - b[0]) * w
    dy = (a[1] - b[1]) * (2 - w)
    return np.sqrt(dx**2 + dy**2)

# For DBSCAN:
# Construct a custom distance matrix or pass metric='precomputed'

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.