Skip to content

Instantly share code, notes, and snippets.

@michiexile
michiexile / gap.py
Created May 23, 2013 10:59
A Python implementation of the Gap Statistic from Tibshirani, Walther, Hastie to determine the inherent number of clusters in a dataset with k-means clustering.
# gap.py
# (c) 2013 Mikael Vejdemo-Johansson
# BSD License
#
# SciPy function to compute the gap statistic for evaluating k-means clustering.
# Gap statistic defined in
# Tibshirani, Walther, Hastie:
# Estimating the number of clusters in a data set via the gap statistic
# J. R. Statist. Soc. B (2001) 63, Part 2, pp 411-423

Keybase proof

I hereby claim:

  • I am michiexile on github.
  • I am michiexile (https://keybase.io/michiexile) on keybase.
  • I have a public key whose fingerprint is 7E64 04C5 2F0F B8E7 7449 5D3D B549 A90C C07C CCCD

To claim this, I am signing this object:

@michiexile
michiexile / RStanExamplesToPyMC3.ipynb
Last active November 30, 2019 21:32
Translating the MTH594 RStan examples to PyMC3
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.