Skip to content

Latest commit

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Function for calculating Density-Based Clustering Validation metric

This function is optimized with numba and multithreading (Not python library) and does not store the distance matrix in memory but computes it inplace using lazy computation approach

Related research: "Density-Based Clustering Validation". Davoud Moulavi, Pablo A. Jaskowiak, Ricardo J. G. B. Campello, Arthur Zimek, Jörg Sander. https://www.dbs.ifi.lmu.de/~zimek/publications/SDM2014/DBCV.pdf

A little bit about implementation

  1. We use Prim's algorithm to find mst

  2. So far, only the square of Euclid's norm is available

    However, it's easy to add the norm you need to this function: wrap the function to compute the norm in an njit decorator with 'signature_for_norms' from src.config like this:

    @numba.njit(signature_for_norms, cache=True)defyour_norm(x, y):
    ...
  3. You can control the number of threads in use via numba.set_num_threads()

Speed

Tests were run on the make_blobs dataset from sklearn.datasets

On average, 15 times faster than realizations from https://github.com/FelSiq/DBCV

Sample size == 10^4

Vector lengthNum. of clustersAv. time of 10 runs for "old" DBCV sec.Av. time of 10 runs for "new" DBCV sec.
6226.861.23
6411.330.60
685.470.34
6104.330.28
8226.531.41
8411.410.69
885.230.37
8104.420.34

Sample size == 10^3

Vector lengthNum. of clustersAv. time of 10 runs for "old" DBCV sec.Av. time of 10 runs for "new" DBCV sec.
620.2090.014
640.1470.012
680.1010.008
6100.1020.008
820.2210.018
840.1320.010
880.1020.008
8100.0980.008

Future plans

  1. Currently the bottleneck of the function is the mst build, which is done in a single thread. It is planned to switch to Boruvka's algorithm, which can be executed in parallel
  2. There are also plans to add support for execution on gpu

About

Provides function for computing Density Based Clusterfig Validation index

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages