test_kmeans.py
Go to the documentation of this file.
00001 #from scipy.cluster.vq import vq
00002 #from scipy.cluster.vq import whiten
00003 
00004 import scipy.cluster.vq as vq
00005 import numpy as np
00006 #Testing kmeans cluster in scipy
00007 
00008 features  = np.array([[ 1.9,2.3],
00009                       [ 1.5,2.5],
00010                       [ 0.8,0.6],
00011                       [ 0.4,1.8],
00012                       [ 0.1,0.1],
00013                       [ 0.2,1.8],
00014                       [ 2.0,0.5],
00015                       [ 0.3,1.5],
00016                       [ 1.0,1.0]])
00017 whitened = vq.whiten(features)
00018 book = np.array((whitened[0],whitened[2]))
00019 vq.kmeans(whitened, book)
00020 


hai_sandbox
Author(s): Hai Nguyen
autogenerated on Wed Nov 27 2013 11:46:56