[Scipy-svn] r4668 - trunk/scipy/cluster

scipy-svn@scip... scipy-svn@scip...
Sat Aug 23 13:10:49 CDT 2008


Author: damian.eads
Date: 2008-08-23 13:10:44 -0500 (Sat, 23 Aug 2008)
New Revision: 4668

Modified:
   trunk/scipy/cluster/distance.py
   trunk/scipy/cluster/hierarchy.py
Log:
Finished RSTifying linkage alias functions.

Modified: trunk/scipy/cluster/distance.py
===================================================================
--- trunk/scipy/cluster/distance.py	2008-08-23 17:56:19 UTC (rev 4667)
+++ trunk/scipy/cluster/distance.py	2008-08-23 18:10:44 UTC (rev 4668)
@@ -79,7 +79,6 @@
 | yule             | the Yule dissimilarity (boolean).               |
 +------------------+-------------------------------------------------+
 
-
 References
 ----------
 

Modified: trunk/scipy/cluster/hierarchy.py
===================================================================
--- trunk/scipy/cluster/hierarchy.py	2008-08-23 17:56:19 UTC (rev 4667)
+++ trunk/scipy/cluster/hierarchy.py	2008-08-23 18:10:44 UTC (rev 4668)
@@ -243,13 +243,15 @@
 
     :Parameters:
         y : ndarray
-            The upper triangular of the distance matrix y. The result of
+            The upper triangular of the distance matrix. The result of
             ``pdist`` is returned in this form.
 
     :Returns:
         Z : ndarray
             The linkage matrix.
 
+    :SeeAlso:
+       - linkage: for advanced creation of hierarchical clusterings.
     """
     return linkage(y, method='single', metric='euclidean')
 
@@ -261,9 +263,14 @@
 
     :Parameters:
         y : ndarray
-            The upper triangular of the distance matrix y. The result of
+            The upper triangular of the distance matrix. The result of
             ``pdist`` is returned in this form.
 
+    :Returns:
+        Z : ndarray
+            A linkage matrix containing the hierarchical clustering. See
+            the ``linkage`` function documentation for more information
+            on its structure.
     """
     return linkage(y, method='complete', metric='euclidean')
 
@@ -275,8 +282,17 @@
 
     :Parameters:
         y : ndarray
-            The upper triangular of the distance matrix y. The result of
+            The upper triangular of the distance matrix. The result of
             ``pdist`` is returned in this form.
+
+    :Returns:
+        Z : ndarray
+            A linkage matrix containing the hierarchical clustering. See
+            the ``linkage`` function documentation for more information
+            on its structure.
+
+    :SeeAlso:
+       - linkage: for advanced creation of hierarchical clusterings.
     """
     return linkage(y, method='average', metric='euclidean')
 
@@ -288,8 +304,17 @@
 
     :Parameters:
         y : ndarray
-            The upper triangular of the distance matrix y. The result of
+            The upper triangular of the distance matrix. The result of
             ``pdist`` is returned in this form.
+
+    :Returns:
+        Z : ndarray
+            A linkage matrix containing the hierarchical clustering. See
+            the ``linkage`` function documentation for more information
+            on its structure.
+
+    :SeeAlso:
+       - linkage: for advanced creation of hierarchical clusterings.
     """
     return linkage(y, method='weighted', metric='euclidean')
 
@@ -298,56 +323,105 @@
     Performs centroid/UPGMC linkage. See ``linkage`` for more
     information on the return structure and algorithm.
 
+    :Parameters:
+        Q : ndarray
+            A condensed or redundant distance matrix. A condensed
+            distance matrix is a flat array containing the upper
+            triangular of the distance matrix. This is the form that
+            ``pdist`` returns. Alternatively, a collection of
+            m observation vectors in n dimensions may be passed as
+            a m by n array.
 
-    Z = centroid(y)
+    :Returns:
+        Z : ndarray
+            A linkage matrix containing the hierarchical clustering. See
+            the ``linkage`` function documentation for more information
+            on its structure.
 
-    Performs centroid/UPGMC linkage on the condensed distance matrix Z.
-    See linkage for more information on the return structure and
-    algorithm.
+    Calling Conventions
+    -------------------
 
-      (a condensed alias for linkage)
+    1. Z = centroid(y)
 
-    Z = centroid(X)
+       Performs centroid/UPGMC linkage on the condensed distance
+       matrix ``y``.  See ``linkage`` for more information on the return
+       structure and algorithm. 
 
-    Performs centroid/UPGMC linkage on the observation matrix X using
-    Euclidean distance as the distance metric. See linkage for more
-    information on the return structure and algorithm.
+    2. Z = centroid(X)
 
+       Performs centroid/UPGMC linkage on the observation matrix ``X``
+       using Euclidean distance as the distance metric. See ``linkage``
+       for more information on the return structure and algorithm.
+
+    :SeeAlso:
+       - linkage: for advanced creation of hierarchical clusterings.
     """
     return linkage(y, method='centroid', metric='euclidean')
 
 def median(y):
     """
-    Z = median(y)
+    Performs median/WPGMC linkage. See ``linkage`` for more
+    information on the return structure and algorithm.
 
-    Performs median/WPGMC linkage on the condensed distance matrix Z.
-    See linkage for more information on the return structure and
-    algorithm.
+    :Parameters:
+        Q : ndarray
+            A condensed or redundant distance matrix. A condensed
+            distance matrix is a flat array containing the upper
+            triangular of the distance matrix. This is the form that
+            ``pdist`` returns. Alternatively, a collection of
+            m observation vectors in n dimensions may be passed as
+            a m by n array.
 
-    Z = median(X)
+    Calling Conventions
+    -------------------
 
-    Performs median/WPGMC linkage on the observation matrix X using
-    Euclidean distance as the distance metric. See linkage for more
-    information on the return structure and algorithm.
+    1. Z = median(y)
 
-      (a condensed alias for linkage)
+       Performs median/WPGMC linkage on the condensed distance matrix
+       ``y``.  See ``linkage`` for more information on the return
+       structure and algorithm.
+
+    2. Z = median(X)
+
+       Performs median/WPGMC linkage on the observation matrix ``X``
+       using Euclidean distance as the distance metric. See linkage
+       for more information on the return structure and algorithm.
+
+    :SeeAlso:
+       - linkage: for advanced creation of hierarchical clusterings.
     """
     return linkage(y, method='median', metric='euclidean')
 
 def ward(y):
     """
-    Z = ward(y)
+    Performs Ward's linkage on a condensed or redundant distance
+    matrix. See linkage for more information on the return structure
+    and algorithm.
 
-    Performs Ward's linkage on the condensed distance matrix Z. See
-    linkage for more information on the return structure and algorithm.
+    :Parameters:
+        Q : ndarray
+            A condensed or redundant distance matrix. A condensed
+            distance matrix is a flat array containing the upper
+            triangular of the distance matrix. This is the form that
+            ``pdist`` returns. Alternatively, a collection of
+            m observation vectors in n dimensions may be passed as
+            a m by n array.
 
-    Z = ward(X)
+    Calling Conventions
+    -------------------
 
-    Performs Ward's linkage on the observation matrix X using Euclidean
-    distance as the distance metric. See linkage for more information
-    on the return structure and algorithm.
+    1. Z = ward(y)
+       Performs Ward's linkage on the condensed distance matrix Z. See
+       linkage for more information on the return structure and
+       algorithm.
 
-      (a condensed alias for linkage)
+    2. Z = ward(X)
+       Performs Ward's linkage on the observation matrix X using
+       Euclidean distance as the distance metric. See linkage for more
+       information on the return structure and algorithm.
+
+    :SeeAlso:
+       - linkage: for advanced creation of hierarchical clusterings.
     """
     return linkage(y, method='ward', metric='euclidean')
 



More information about the Scipy-svn mailing list