Code Monkey home page Code Monkey logo

cdbw's Introduction

CDbw

Compute the S_Dbw validity index
S_Dbw validity index is defined by equation:

CDbw = compactness*cohesion*separation

Highest value -> better clustering.


Installation:

pip install --upgrade cdbw

Usage:

from cdbw import CDbw
score = CDbw(X, labels, metric="euclidean", alg_noise='comb', 
     intra_dens_inf=False, s=3, multipliers=False)

Parameters:

X : array-like, shape (n_samples, n_features)
    List of n_features-dimensional data points. Each row corresponds
    to a single data point.
labels : array-like, shape (n_samples,)
    Predicted labels for each sample.  (-1 - for noise)
metric : str,
    The distance metric, can be ‘braycurtis’, ‘canberra’, ‘chebyshev’, ‘cityblock’, ‘correlation’,
    ‘cosine’, ‘dice’, ‘euclidean’, ‘hamming’, ‘jaccard’, ‘kulsinski’, ‘mahalanobis’, ‘matching’, ‘minkowski’,
    ‘rogerstanimoto’, ‘russellrao’, ‘seuclidean’, ‘sokalmichener’, ‘sokalsneath’, ‘sqeuclidean’, ‘wminkowski’,
    ‘yule’.
alg_noise : str,
    Algorithm for recording noise points.
    'comb' - combining all noise points into one cluster (default)
    'sep' - definition of each noise point as a separate cluster
    'bind' -  binding of each noise point to the cluster nearest from it
    'filter' - filtering noise points
intra_dens_inf : bool,
    If False (default) CDbw index = 0 for cohesion or compactness - inf or nan.
s : int,
    Number of art representative points. (>2)
multipliers : bool,
    Format of output. False (default) - only CDbw index, True - tuple (compactness, cohesion, separation, CDbw)

Returns:

cdbw : float,
    The resulting CDbw validity index.

References:

  1. M. Halkidi and M. Vazirgiannis, “A density-based cluster validity approach using multi-representatives” Pattern Recognition Letters 29 (2008) 773–786.

cdbw's People

Contributors

alashkov83 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

nickfsoares

cdbw's Issues

Unnecessary computations of convex hulls

The line ch = ConvexHull(coord_in_cl[i, 0:n_points_in_cl[i], 0:dimension]) is computed twice per cluster (cdbw.py lines 208 and 216) with exactly the same parameters. From the result, only the vertices are used. It would speed up the computation of the cdbw (especially in higher dimensions) if the vertices are stored, so this computation is only done once

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.