Ignore:
Timestamp:
02/06/12 16:33:23 (2 years ago)
Author:
markotoplak
Branch:
default
Message:

Moved instance_distance_matrix to Orange.distance.distance_matrix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/clustering/hierarchical.py

    r9724 r9752  
    451451.. autofunction:: pruned 
    452452.. autofunction:: cluster_depths 
    453 .. autofunction:: instance_distance_matrix 
    454453.. autofunction:: feature_distance_matrix 
    455454.. autofunction:: joining_cluster 
     
    15091508    return depths 
    15101509 
    1511  
    1512 def instance_distance_matrix(data, 
    1513             distance_constructor=Orange.distance.Euclidean, 
    1514             progress_callback=None): 
    1515     """ A helper function that computes an :class:`Orange.core.SymMatrix` of all 
    1516     pairwise distances between instances in `data`. 
    1517      
    1518     :param data: A data table 
    1519     :type data: :class:`Orange.data.Table` 
    1520      
    1521     :param distance_constructor: An DistanceConstructor instance. 
    1522     :type distance_constructor: :class:`Orange.distance.DistanceConstructor` 
    1523      
    1524     :param progress_callback: A function (taking one argument) to use for 
    1525         reporting the on the progress. 
    1526     :type progress_callback: function 
    1527      
    1528     :rtype: :class:`Orange.core.SymMatrix` 
    1529      
    1530     """ 
    1531     matrix = orange.SymMatrix(len(data)) 
    1532     dist = distance_constructor(data) 
    1533      
    1534     iter_count = matrix.dim * (matrix.dim - 1) / 2 
    1535     milestones = progress_bar_milestones(iter_count, 100) 
    1536      
    1537     for count, ((i, ex1), (j, ex2)) in enumerate(_pairs(enumerate(data))): 
    1538         matrix[i, j] = dist(ex1, ex2) 
    1539         if progress_callback and count in milestones: 
    1540             progress_callback(100.0 * count / iter_count) 
    1541              
    1542     return matrix  
    1543  
     1510instance_distance_matrix = Orange.distance.distance_matrix 
    15441511 
    15451512def feature_distance_matrix(data, distance=None, progress_callback=None): 
Note: See TracChangeset for help on using the changeset viewer.