Changeset 9975:984015996c2e in orange


Ignore:
Timestamp:
02/07/12 20:56:43 (2 years ago)
Author:
ales_erjavec
Branch:
default
Message:

Camel case fixes, unimplemented scoring functions now raise an error.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/clustering/kmeans.py

    r9725 r9975  
    176176score_distance_to_centroids.minimize = True 
    177177 
    178 def score_conditionalEntropy(km): 
     178def score_conditional_entropy(km): 
    179179    """UNIMPLEMENTED cluster quality measured by conditional entropy""" 
    180     pass 
    181  
    182 def score_withinClusterDistance(km): 
     180    raise NotImplemented 
     181 
     182def score_within_cluster_distance(km): 
    183183    """UNIMPLEMENTED weighted average within-cluster pairwise distance""" 
    184     pass 
     184    raise NotImplemented 
    185185 
    186186score_withinClusterDistance.minimize = True 
    187187 
    188 def score_betweenClusterDistance(km): 
     188def score_between_cluster_distance(km): 
    189189    """Sum of distances from elements to 'nearest miss' centroids""" 
    190190    return sum(min(km.distance(c, d) for j,c in enumerate(km.centroids) if j!=km.clusters[i]) for i,d in enumerate(km.data)) 
     191 
     192from Orange.misc import deprecated_function_name 
     193score_betweenClusterDistance = deprecated_function_name(score_between_cluster_distance) 
    191194 
    192195def score_silhouette(km, index=None): 
Note: See TracChangeset for help on using the changeset viewer.