Changeset 9722:25e9a610d61f in orange


Ignore:
Timestamp:
02/06/12 12:31:53 (2 years ago)
Author:
markotoplak
Branch:
default
rebase_source:
179383525fa97098b01e52bc6ad43b784367294f
Message:

Orange.distance name changing.

Location:
Orange
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Orange/distance/__init__.py

    r9721 r9722  
    11import Orange 
    22 
     3#%s/ExamplesDistanceConstructor/DistanceConstructor/gc 
     4#%s/ExamplesDistance_Normalized/DistanceNormalized/gc 
    35#ExampleDistance -> Distance 
    4 #ExampleDistanceConstructor -> DistanceConstructor 
    56#Hamming -> HammingDistance 
    67#DTW -> DTWDistance 
     
    2122#MahalanobisConstructor ->  Mahalanobis 
    2223#Mahalanobis -> MahalanobisDistance 
    23 #ExamplesDistance_Normalized -> Distance_Normalized 
    2424 
    2525from Orange.core import \ 
    26      AlignmentList, \ 
    27      DistanceMap, \ 
    28      DistanceMapConstructor, \ 
    29      ExampleDistConstructor, \ 
    30      ExampleDistBySorting, \ 
    31      ExampleDistVector, \ 
    32      ExamplesDistance as Distance, \ 
    33      ExamplesDistance_Normalized as DistanceNormalized, \ 
    34      ExamplesDistanceConstructor as DistanceConstructor 
    35  
    36 from Orange.core import ExamplesDistance_Hamming as HammingDistance 
    37 from Orange.core import ExamplesDistance_DTW as DTWDistance 
    38 from Orange.core import ExamplesDistance_Euclidean as EuclideanDistance 
    39 from Orange.core import ExamplesDistance_Manhattan as ManhattanDistance 
    40 from Orange.core import ExamplesDistance_Maximal as MaximalDistance 
    41 from Orange.core import ExamplesDistance_Relief as ReliefDistance 
    42  
    43 from Orange.core import ExamplesDistanceConstructor_DTW as DTW 
    44 from Orange.core import ExamplesDistanceConstructor_Euclidean as Euclidean 
    45 from Orange.core import ExamplesDistanceConstructor_Hamming as Hamming 
    46 from Orange.core import ExamplesDistanceConstructor_Manhattan as Manhattan 
    47 from Orange.core import ExamplesDistanceConstructor_Maximal as Maximal 
    48 from Orange.core import ExamplesDistanceConstructor_Relief as Relief 
     26    AlignmentList, \ 
     27    DistanceMap, \ 
     28    DistanceMapConstructor, \ 
     29    ExampleDistConstructor, \ 
     30    ExampleDistBySorting, \ 
     31    ExampleDistVector, \ 
     32    ExamplesDistance as Distance, \ 
     33    ExamplesDistance_Normalized as DistanceNormalized, \ 
     34    ExamplesDistanceConstructor as DistanceConstructor, \ 
     35    ExamplesDistance_Hamming as HammingDistance, \ 
     36    ExamplesDistance_DTW as DTWDistance, \ 
     37    ExamplesDistance_Euclidean as EuclideanDistance, \ 
     38    ExamplesDistance_Manhattan as ManhattanDistance, \ 
     39    ExamplesDistance_Maximal as MaximalDistance, \ 
     40    ExamplesDistance_Relief as ReliefDistance, \ 
     41    ExamplesDistanceConstructor_DTW as DTW, \ 
     42    ExamplesDistanceConstructor_Euclidean as Euclidean, \ 
     43    ExamplesDistanceConstructor_Hamming as Hamming, \ 
     44    ExamplesDistanceConstructor_Manhattan as Manhattan, \ 
     45    ExamplesDistanceConstructor_Maximal as Maximal, \ 
     46    ExamplesDistanceConstructor_Relief as Relief 
    4947 
    5048import statc 
     
    5654     
    5755    def __new__(cls, data=None, **argkw): 
    58         self = ExamplesDistanceConstructor.__new__(cls, **argkw) 
     56        self = DistanceConstructor.__new__(cls, **argkw) 
    5957        self.__dict__.update(argkw) 
    6058        if data: 
     
    148146     
    149147    def __new__(cls, data=None, **argkw): 
    150         self = ExamplesDistanceConstructor.__new__(cls, **argkw) 
     148        self = DistanceConstructor.__new__(cls, **argkw) 
    151149        self.__dict__.update(argkw) 
    152150        if data: 
     
    200198     
    201199     
    202 class PearsonRAbsolute(PearsonRConstructor): 
     200class PearsonRAbsolute(PearsonR): 
    203201    """ Construct an instance of PearsonRAbsolute example distance estimator. 
    204202    """ 
     
    209207     
    210208     
    211 class PearsonRAbsoluteDistance(PearsonR): 
     209class PearsonRAbsoluteDistance(PearsonRDistance): 
    212210    """ An example distance estimator using absolute value of Pearson 
    213211    correlation coefficient. 
     
    235233         
    236234         
    237 class SpearmanRAbsolute(SpearmanRConstructor): 
     235class SpearmanRAbsolute(SpearmanR): 
    238236    """ Construct an instance of SpearmanRAbsolute example distance estimator. 
    239237    """ 
     
    244242     
    245243     
    246 class SpearmanRAbsoluteDistance(SpearmanR): 
     244class SpearmanRAbsoluteDistance(SpearmanRDistance): 
    247245    def __call__(self, e1, e2): 
    248246        """ 
     
    274272    :type data: :obj:`Orange.data.Table` 
    275273     
    276     :param distance_constructor: An ExamplesDistance_Constructor instance. 
    277     :type distance_constructor: :obj:`Orange.distances.ExampleDistConstructor` 
     274    :param distance_constructor: An DistanceConstructor instance. 
     275    :type distance_constructor: :obj:`Orange.distances.DistanceConstructor` 
    278276     
    279277    """ 
  • Orange/fixes/fix_changed_names.py

    r9697 r9722  
    102102           "orange.ImputerConstructor_average": "Orange.feature.imputation.ImputerConstructor_average", 
    103103 
    104            "orange.ExamplesDistance_Normalized": "Orange.distance.ExamplesDistance_Normalized", 
    105            "orange.ExamplesDistanceConstructor": "Orange.distance.ExamplesDistanceConstructor", 
    106            "orange.ExamplesDistance_Hamming": "Orange.distance.Hamming", 
    107            "orange.ExamplesDistance_DTW": "Orange.distance.DTW", 
    108            "orange.ExamplesDistance_Euclidean": "Orange.distance.Euclidean", 
    109            "orange.ExamplesDistance_Manhattan": "Orange.distance.Manhattan", 
    110            "orange.ExamplesDistance_Maximal": "Orange.distance.Maximal", 
    111            "orange.ExamplesDistance_Relief": "Orange.distance.Relief", 
    112  
    113            "orange.ExamplesDistanceConstructor_DTW": "Orange.distance.DTWConstructor", 
    114            "orange.ExamplesDistanceConstructor_Euclidean": "Orange.distance.EuclideanConstructor", 
    115            "orange.ExamplesDistanceConstructor_Hamming": "Orange.distance.HammingConstructor", 
    116            "orange.ExamplesDistanceConstructor_Manhattan": "Orange.distance.ManhattanConstructor", 
    117            "orange.ExamplesDistanceConstructor_Maximal": "Orange.distance.MaximalConstructor", 
    118            "orange.ExamplesDistanceConstructor_Relief": "Orange.distance.ReliefConstructor", 
    119  
    120            "orngClustering.ExamplesDistanceConstructor_PearsonR": "Orange.distance.PearsonRConstructor", 
    121            "orngClustering.ExamplesDistance_PearsonR": "Orange.distance.PearsonR", 
    122            "orngClustering.ExamplesDistanceConstructor_SpearmanR": "Orange.distance.SpearmanRConstructor", 
    123            "orngClustering.ExamplesDistance_SpearmanR": "Orange.distance.SpearmanR", 
     104           "orange.ExampleDistance": "Orange.distance.Distance", 
     105           "orange.ExamplesDistance_Normalized": "Orange.distance.DistanceNormalized", 
     106           "orange.ExamplesDistanceConstructor": "Orange.distance.DistanceConstructor", 
     107           "orange.ExamplesDistance_Hamming": "Orange.distance.HammingDistance", 
     108           "orange.ExamplesDistance_DTW": "Orange.distance.DTWDistance", 
     109           "orange.ExamplesDistance_Euclidean": "Orange.distance.EuclideanDistance", 
     110           "orange.ExamplesDistance_Manhattan": "Orange.distance.ManhattanDistance", 
     111           "orange.ExamplesDistance_Maximal": "Orange.distance.MaximalDistance", 
     112           "orange.ExamplesDistance_Relief": "Orange.distance.ReliefDistance", 
     113 
     114           "orange.ExamplesDistanceConstructor_DTW": "Orange.distance.DTW", 
     115           "orange.ExamplesDistanceConstructor_Euclidean": "Orange.distance.Euclidean", 
     116           "orange.ExamplesDistanceConstructor_Hamming": "Orange.distance.Hamming", 
     117           "orange.ExamplesDistanceConstructor_Manhattan": "Orange.distance.Manhattan", 
     118           "orange.ExamplesDistanceConstructor_Maximal": "Orange.distance.Maximal", 
     119           "orange.ExamplesDistanceConstructor_Relief": "Orange.distance.Relief", 
     120 
     121           "orngClustering.ExamplesDistanceConstructor_PearsonR": "Orange.distance.PearsonR", 
     122           "orngClustering.ExamplesDistance_PearsonR": "Orange.distance.PearsonRDistance", 
     123           "orngClustering.ExamplesDistanceConstructor_SpearmanR": "Orange.distance.SpearmanR", 
     124           "orngClustering.ExamplesDistance_SpearmanR": "Orange.distance.SpearmanRDistance", 
    124125 
    125126           "orngClustering.KMeans": "Orange.clustering.kmeans.Clustering", 
Note: See TracChangeset for help on using the changeset viewer.