Giter Club home page Giter Club logo

clustergram's Introduction

clustergram.py ፨

For visual inspection of how samples change clusters as a function of a parameter.

Installation

Unpack the clustergram folder into your working directory, or append to your sys.path.

In case you're missing some of the dependencies run:

$ pip install -r requirements.txt

Usage example

from clustergram import Clustergram

Clustergram().draw(x, clusters, targets=y, scoring=True, linewidth=0.5)

Reference

Clustergram exposes only one function, draw, for which short parameter reference follows below:

  x                 -  x values
  clusters          -  array of the shape (n_xvals, n_samples) of cluster IDs to which each sample belongs
  targets           -  if true labels are known, colors the plot accordingly
  sort              -  sort by targets (if supplied), hence aggregating and making true clusters easier to spot
  scoring           -  adds subplots with clustering scores using `sklearn.metrics`
  scoring_X         -  original feature array of the shape (n_samples, n_features) required for `sklearn.metrics.silhouette_score`
  optimize_labeling -  for best visual results, optimize cluster labeling as to minimize number of samples changing clusters between each step

For remaining parameters (mostly self-explanatory) see the source.

Example output

Clustergram with scoring plots, using data from the zoo dataset, and the BCPNN classifier (which uses the x values as the softmax probability distribution parameter G in the transfer function).

Example screenshot

clustergram's People

Contributors

mwielondek avatar

Stargazers

 avatar

Watchers

 avatar

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.