Skip to content

Instantly share code, notes, and snippets.


Tim van Werkhoven tvwerkhoven

  • ASML
  • Netherlands
View GitHub Profile
tvwerkhoven /
Created Jun 2, 2018 — forked from bistaumanga/
KMeans Clustering Implemented in python with numpy
'''Implementation and of K Means Clustering
Requires : python 2.7.x, Numpy 1.7.1+'''
import numpy as np
def kMeans(X, K, maxIters = 10, plot_progress = None):
centroids = X[np.random.choice(np.arange(len(X)), K)]
for i in range(maxIters):
# Cluster Assignment step
C = np.array([np.argmin([, x_i-y_k) for y_k in centroids]) for x_i in X])
tvwerkhoven /
Last active Jul 24, 2020 — forked from necolas/rsync_backup
Improved script: - Check if run as root - Clarify rsync(1) flags - Add --inplace for performance, extra preservation flags - Check bless(8) target before setting Improved exclusion file: - Included files listed by Carbon Copy Cloner
# This script backups an OS X system to an external volume, effectively
# cloning it. It is based on [0], [1] and [2] for OS X and [3] and [4] for
# Linux. One could also use commercial tools like SuperDuper! or Carbon Copy
# Cloner. The latter website has an interesting list[5] on what files to
# exclude when cloning.
# Exclusions (from CCC[5]), see rsync_excludes_osx.txt
You can’t perform that action at this time.