Changeset 8059:f294534915ee in orange


Ignore:
Timestamp:
07/01/11 15:42:57 (3 years ago)
Author:
markotoplak
Branch:
default
Convert:
5d0de536fb80e17812b87b98035536932a2bb91d
Message:

Moved Orange.distances into Orange.distance.instances.

Location:
orange
Files:
4 added
2 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • orange/Orange/__init__.py

    r8042 r8059  
    6767_import("preprocess.scaling") 
    6868 
    69 _import("distances") 
     69_import("distance") 
     70_import("distance.instances") 
    7071 
    7172_import("wrappers") 
  • orange/Orange/clustering/hierarchical.py

    r8053 r8059  
    485485    :type data: :class:`Orange.data.Table` 
    486486    :param distance_constructor: Instance distance constructor 
    487     :type distance_constructor: :class:`Orange.distances.ExamplesDistanceConstructor` 
     487    :type distance_constructor: :class:`Orange.distance.instances.ExamplesDistanceConstructor` 
    488488    :param linkage: Linkage flag. Must be one of global module level flags: 
    489489     
     
    13761376     
    13771377    :param distance_constructor: An ExamplesDistance_Constructor instance. 
    1378     :type distance_constructor: :class:`Orange.distances.ExampleDistConstructor` 
     1378    :type distance_constructor: :class:`Orange.distance.instances.ExampleDistConstructor` 
    13791379     
    13801380    """ 
  • orange/Orange/evaluation/reliability.py

    r8042 r8059  
    453453    def __call__(self, examples, learner): 
    454454        nearest_neighbours_constructor = Orange.classification.knn.FindNearestConstructor() 
    455         nearest_neighbours_constructor.distanceConstructor = Orange.distances.EuclideanConstructor() 
     455        nearest_neighbours_constructor.distanceConstructor = Orange.distance.instances.EuclideanConstructor() 
    456456         
    457457        distance_id = Orange.core.newmetaid() 
     
    516516    def __call__(self, examples, learner): 
    517517        nearest_neighbours_constructor = Orange.classification.knn.FindNearestConstructor() 
    518         nearest_neighbours_constructor.distanceConstructor = Orange.distances.EuclideanConstructor() 
     518        nearest_neighbours_constructor.distanceConstructor = Orange.distance.instances.EuclideanConstructor() 
    519519         
    520520        distance_id = Orange.core.newmetaid() 
     
    562562    def __call__(self, examples, *args): 
    563563        nnm = Orange.classification.knn.FindNearestConstructor() 
    564         nnm.distanceConstructor = Orange.distances.MahalanobisConstructor() 
     564        nnm.distanceConstructor = Orange.distance.instances.MahalanobisConstructor() 
    565565         
    566566        mid = Orange.core.newmetaid() 
  • orange/Orange/preprocess/outliers.py

    r8042 r8059  
    7676        self.examples = examples 
    7777        if (distance == None): 
    78           distance = Orange.distances.ManhattanConstructor(self.examples) 
     78          distance = Orange.distance.instances.ManhattanConstructor(self.examples) 
    7979        self.distance = distance 
    8080 
  • orange/doc/Orange/rst/Orange.regression.mean.rst

    r7571 r8059  
     1################ 
     2Mean (``mean``) 
     3################ 
     4 
    15.. automodule:: Orange.regression.mean 
  • orange/doc/Orange/rst/code/distances-test.py

    r8042 r8059  
    55 
    66# Euclidean distance constructor 
    7 d2Constr = Orange.distances.EuclideanConstructor() 
     7d2Constr = Orange.distance.instances.EuclideanConstructor() 
    88d2 = d2Constr(table) 
    99 
    1010# Constructs  
    11 dPears = Orange.distances.PearsonRConstructor(table) 
     11dPears = Orange.distance.instances.PearsonRConstructor(table) 
    1212 
    1313#reference instance 
  • orange/doc/Orange/rst/code/mds-euclid-torgerson-3d.py

    r8042 r8059  
    1111 
    1212# Construct a distance matrix using Euclidean distance 
    13 dist = Orange.distances.EuclideanConstructor(table) 
     13dist = Orange.distance.instances.EuclideanConstructor(table) 
    1414matrix = Orange.core.SymMatrix(len(table)) 
    1515matrix.setattr('items', table) 
  • orange/doc/Orange/rst/code/mds-scatterplot.py

    r8042 r8059  
    1111 
    1212# Construct a distance matrix using Euclidean distance 
    13 euclidean = Orange.distances.EuclideanConstructor(table) 
     13euclidean = Orange.distance.instances.EuclideanConstructor(table) 
    1414distance = Orange.core.SymMatrix(len(table)) 
    1515for i in range(len(table)): 
  • orange/doc/Orange/rst/code/outlier2.py

    r7780 r8059  
    33data = Orange.data.Table("bridges") 
    44outlier_det = Orange.preprocess.outliers.OutlierDetection() 
    5 outlier_det.set_examples(data, Orange.distances.EuclideanConstructor(data)) 
     5outlier_det.set_examples(data, Orange.distance.instances.EuclideanConstructor(data)) 
    66outlier_det.set_knn(3) 
    77z_values = outlier_det.z_values() 
  • orange/doc/Orange/rst/index.rst

    r7780 r8059  
    1919   Orange.clustering 
    2020    
    21    Orange.distances 
     21   Orange.distance 
    2222 
    2323   Orange.ensemble 
  • orange/fixes/fix_changed_names.py

    r8042 r8059  
    9191           "orange.ImputerConstructor_average": "Orange.feature.imputation.ImputerConstructor_average", 
    9292  
    93            "orange.ExamplesDistance_Normalized": "Orange.distances.ExamplesDistance_Normalized", 
    94            "orange.ExamplesDistanceConstructor": "Orange.distances.ExamplesDistanceConstructor", 
    95            "orange.ExamplesDistance_Hamming": "Orange.distances.Hamming", 
    96            "orange.ExamplesDistance_DTW": "Orange.distances.DTW",  
    97            "orange.ExamplesDistance_Euclidean": "Orange.distances.Euclidean",  
    98            "orange.ExamplesDistance_Manhattan": "Orange.distances.Manhattan",  
    99            "orange.ExamplesDistance_Maximal": "Orange.distances.Maximal",  
    100            "orange.ExamplesDistance_Relief": "Orange.distances.Relief",  
    101             
    102            "orange.ExamplesDistanceConstructor_DTW": "Orange.distances.DTWConstructor",  
    103            "orange.ExamplesDistanceConstructor_Euclidean": "Orange.distances.EuclideanConstructor",  
    104            "orange.ExamplesDistanceConstructor_Hamming": "Orange.distances.HammingConstructor", 
    105            "orange.ExamplesDistanceConstructor_Manhattan": "Orange.distances.ManhattanConstructor", 
    106            "orange.ExamplesDistanceConstructor_Maximal": "Orange.distances.MaximalConstructor", 
    107            "orange.ExamplesDistanceConstructor_Relief": "Orange.distances.ReliefConstructor", 
    108             
    109            "orngClustering.ExamplesDistanceConstructor_PearsonR": "Orange.distances.PearsonRConstructor", 
    110            "orngClustering.ExamplesDistance_PearsonR": "Orange.distances.PearsonR", 
    111            "orngClustering.ExamplesDistanceConstructor_SpearmanR": "Orange.distances.SpearmanRConstructor", 
    112            "orngClustering.ExamplesDistance_SpearmanR": "Orange.distances.SpearmanR", 
     93           "orange.ExamplesDistance_Normalized": "Orange.distance.instances.ExamplesDistance_Normalized", 
     94           "orange.ExamplesDistanceConstructor": "Orange.distance.instances.ExamplesDistanceConstructor", 
     95           "orange.ExamplesDistance_Hamming": "Orange.distance.instances.Hamming", 
     96           "orange.ExamplesDistance_DTW": "Orange.distance.instances.DTW",  
     97           "orange.ExamplesDistance_Euclidean": "Orange.distance.instances.Euclidean",  
     98           "orange.ExamplesDistance_Manhattan": "Orange.distance.instances.Manhattan",  
     99           "orange.ExamplesDistance_Maximal": "Orange.distance.instances.Maximal",  
     100           "orange.ExamplesDistance_Relief": "Orange.distance.instances.Relief",  
     101            
     102           "orange.ExamplesDistanceConstructor_DTW": "Orange.distance.instances.DTWConstructor",  
     103           "orange.ExamplesDistanceConstructor_Euclidean": "Orange.distance.instances.EuclideanConstructor",  
     104           "orange.ExamplesDistanceConstructor_Hamming": "Orange.distance.instances.HammingConstructor", 
     105           "orange.ExamplesDistanceConstructor_Manhattan": "Orange.distance.instances.ManhattanConstructor", 
     106           "orange.ExamplesDistanceConstructor_Maximal": "Orange.distance.instances.MaximalConstructor", 
     107           "orange.ExamplesDistanceConstructor_Relief": "Orange.distance.instances.ReliefConstructor", 
     108            
     109           "orngClustering.ExamplesDistanceConstructor_PearsonR": "Orange.distance.instances.PearsonRConstructor", 
     110           "orngClustering.ExamplesDistance_PearsonR": "Orange.distance.instances.PearsonR", 
     111           "orngClustering.ExamplesDistanceConstructor_SpearmanR": "Orange.distance.instances.SpearmanRConstructor", 
     112           "orngClustering.ExamplesDistance_SpearmanR": "Orange.distance.instances.SpearmanR", 
    113113            
    114114           "orngClustering.KMeans": "Orange.clustering.kmeans.Clustering", 
  • orange/orngClustering.py

    r8042 r8059  
    22# from Orange.cluster.hierarchical import *  
    33 
    4 from Orange.distances import \ 
     4from Orange.distance.instances import \ 
    55     AlignmentList, \ 
    66     DistanceMap, \ 
     
    1313     ExamplesDistanceConstructor 
    1414 
    15 from Orange.distances import Hamming as ExamplesDistance_Hamming 
    16 from Orange.distances import DTW as ExamplesDistance_DTW 
    17 from Orange.distances import Euclidean as ExamplesDistance_Euclidean 
    18 from Orange.distances import Manhattan as ExamplesDistance_Manhattan 
    19 from Orange.distances import Maximal as ExamplesDistance_Maximal 
    20 from Orange.distances import Relief as ExamplesDistance_Relief 
     15from Orange.distance.instances import Hamming as ExamplesDistance_Hamming 
     16from Orange.distance.instances import DTW as ExamplesDistance_DTW 
     17from Orange.distance.instances import Euclidean as ExamplesDistance_Euclidean 
     18from Orange.distance.instances import Manhattan as ExamplesDistance_Manhattan 
     19from Orange.distance.instances import Maximal as ExamplesDistance_Maximal 
     20from Orange.distance.instances import Relief as ExamplesDistance_Relief 
    2121 
    22 from Orange.distances import DTWConstructor as ExamplesDistanceConstructor_DTW 
    23 from Orange.distances import EuclideanConstructor as ExamplesDistanceConstructor_Euclidean 
    24 from Orange.distances import HammingConstructor as ExamplesDistanceConstructor_Hamming 
    25 from Orange.distances import ManhattanConstructor as ExamplesDistanceConstructor_Manhattan 
    26 from Orange.distances import MaximalConstructor as ExamplesDistanceConstructor_Maximal  
    27 from Orange.distances import ReliefConstructor as ExamplesDistanceConstructor_Relief 
     22from Orange.distance.instances import DTWConstructor as ExamplesDistanceConstructor_DTW 
     23from Orange.distance.instances import EuclideanConstructor as ExamplesDistanceConstructor_Euclidean 
     24from Orange.distance.instances import HammingConstructor as ExamplesDistanceConstructor_Hamming 
     25from Orange.distance.instances import ManhattanConstructor as ExamplesDistanceConstructor_Manhattan 
     26from Orange.distance.instances import MaximalConstructor as ExamplesDistanceConstructor_Maximal  
     27from Orange.distance.instances import ReliefConstructor as ExamplesDistanceConstructor_Relief 
    2828 
    29 from Orange.distances import PearsonRConstructor as ExamplesDistanceConstructor_PearsonR 
    30 from Orange.distances import PearsonR as ExamplesDistance_PearsonR 
    31 from Orange.distances import SpearmanRConstructor as ExamplesDistanceConstructor_SpearmanR 
    32 from Orange.distances import SpearmanR as ExamplesDistance_SpearmanR 
     29from Orange.distance.instances import PearsonRConstructor as ExamplesDistanceConstructor_PearsonR 
     30from Orange.distance.instances import PearsonR as ExamplesDistance_PearsonR 
     31from Orange.distance.instances import SpearmanRConstructor as ExamplesDistanceConstructor_SpearmanR 
     32from Orange.distance.instances import SpearmanR as ExamplesDistance_SpearmanR 
    3333 
    3434 
Note: See TracChangeset for help on using the changeset viewer.