Changeset 10136:546fb2755771 in orange


Ignore:
Timestamp:
02/08/12 22:16:42 (2 years ago)
Author:
markotoplak
Branch:
default
rebase_source:
b960190c70464de75b17629e243b14b73f535c15
Message:

Update for hierarchical.

Files:
3 added
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/clustering/hierarchical.py

    r10106 r10136  
    1 r""" 
     1""" 
    22****************************************** 
    33Hierarchical clustering (``hierarchical``) 
     
    55 
    66.. index:: 
    7    single: clustering, hierarchical, dendrogram 
     7    single: clustering, hierarchical, dendrogram 
     8 
    89.. index:: aglomerative clustering 
    910 
     
    2425    :lines: 1-12 
    2526 
    26 Data instances belonging to the top-most four clusters could be printed out 
     27Data instances belonging to the top-most four clusters  
     28(obtained with :obj:`top_clusters`) could be printed out 
    2729with: 
    2830 
     
    4951    :lines: 1-7 
    5052  
    51  
    5253Basic functionality 
    5354------------------- 
     
    9495        :type matrix: :class:`Orange.misc.SymMatrix` 
    9596 
    96  
    97      
    98  
     97Drawing 
     98-------------- 
     99 
     100.. autofunction:: dendrogram_draw 
     101 
     102.. rubric:: Example 
     103 
     104The following scripts clusters a subset of 20 instances from the Iris data set. 
     105The leaves are labelled with the class value. 
     106 
     107.. literalinclude:: code/hierarchical-draw.py 
     108    :lines: 1-8 
     109 
     110The resulting dendrogram is shown below. 
     111 
     112.. image:: files/hclust-dendrogram.png 
     113 
     114The following code, that produces the dendrogram below, also colors the 
     115three topmost branches and represents attribute values with a custom color 
     116schema, (spanning red - black - green with custom gamma minv and maxv). 
     117 
     118.. literalinclude:: code/hierarchical-draw.py 
     119    :lines: 10-16 
     120 
     121.. image:: files/hclust-colored-dendrogram.png 
    99122    
    100123Cluster analysis 
     
    301324    [[1, 2, 6], [3], [5, 7, 8, 9], [0, 4]] 
    302325 
    303 Output 
    304 -------------- 
    305  
    306 .. autofunction:: dendrogram_layout 
    307 .. autofunction:: dendrogram_draw 
    308  
    309326Utility Functions 
    310327----------------- 
     
    312329.. autofunction:: clustering_features 
    313330.. autofunction:: feature_distance_matrix 
     331.. autofunction:: dendrogram_layout 
    314332 
    315333""" 
     334 
    316335 
    317336import orange 
     
    10951114    """ Plot the dendrogram to ``file``. 
    10961115     
    1097     :param file: An  open file or a filename to store the image to. 
     1116    :param file: An  open file or a filename to store the image to. The output format 
     1117    is chosen according to the extension. Supported formats: PNG, EPS, SVG. 
    10981118    :type file: str or an file-like object suitable for writing. 
    10991119     
Note: See TracChangeset for help on using the changeset viewer.