[Scipy-svn] r2604 - trunk/Lib/cluster

scipy-svn at scipy.org scipy-svn at scipy.org
Wed Jan 24 03:35:03 CST 2007


Author: jarrod.millman
Date: 2007-01-24 03:35:02 -0600 (Wed, 24 Jan 2007)
New Revision: 2604

Modified:
   trunk/Lib/cluster/vq.py
Log:
added imports to doctests


Modified: trunk/Lib/cluster/vq.py
===================================================================
--- trunk/Lib/cluster/vq.py	2007-01-24 09:21:49 UTC (rev 2603)
+++ trunk/Lib/cluster/vq.py	2007-01-24 09:35:02 UTC (rev 2604)
@@ -18,9 +18,9 @@
 __all__ = ['whiten', 'vq', 'kmeans']
 
 from numpy.random import randint
-from scipy.stats import std, mean
 from numpy import shape, zeros, subtract, sqrt, argmin, minimum, array, \
      newaxis, arange, compress, equal, common_type, single, double, take
+from scipy.stats import std, mean
 
 def whiten(obs):
     """ Normalize a group of observations on a per feature basis
@@ -54,6 +54,8 @@
 
         Test
 
+            >>> from numpy import array
+            >>> from scipy.cluster.vq import whiten
             >>> features  = array([[  1.9,2.3,1.7],
             ...                    [  1.5,2.5,2.2],
             ...                    [  0.8,0.6,1.7,]])
@@ -110,6 +112,8 @@
 
         Test
 
+            >>> from numpy import array
+            >>> from scipy.cluster.vq import vq
             >>> code_book = array([[1.,1.,1.],
             ...                    [2.,2.,2.]])
             >>> features  = array([[  1.9,2.3,1.7],
@@ -192,6 +196,8 @@
 
         Note: not whitened in this example.
 
+        >>> from numpy import array
+        >>> from scipy.cluster.vq import kmeans_
         >>> features  = array([[ 1.9,2.3],
         ...                    [ 1.5,2.5],
         ...                    [ 0.8,0.6],
@@ -264,6 +270,8 @@
 
         ("Not checked carefully for accuracy..." he said sheepishly)
 
+        >>> from numpy import array
+        >>> from scipy.cluster.vq import vq, kmeans
         >>> features  = array([[ 1.9,2.3],
         ...                    [ 1.5,2.5],
         ...                    [ 0.8,0.6],



More information about the Scipy-svn mailing list