Skip to content

Instantly share code, notes, and snippets.

View teruo41's full-sized avatar

Teruo Tanimoto teruo41

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@teruo41
teruo41 / xfsinv2json.py
Last active August 20, 2017 07:32
Exporting XFS inventory in JSON format
#!/usr/bin/env python3
import sys # for sys.stderr
import argparse
import subprocess
import json
class Xfsinv2json:
def parse_args(self):
@teruo41
teruo41 / gap.py
Created October 8, 2016 10:18 — forked from michiexile/gap.py
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