Changeset 9889:3a754edd2092 in orange


Ignore:
Timestamp:
02/07/12 10:00:07 (2 years ago)
Author:
markotoplak
Branch:
default
rebase_source:
0cb1d4cdf41fbe6831998da95d3927a2d9b1260d
Message:

Fixed 2.5 examples that used Orange.distance.instances

Location:
docs/reference/rst/code
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • docs/reference/rst/code/distances-test.py

    r9823 r9889  
    55 
    66# Euclidean distance constructor 
    7 d2Constr = Orange.distance.instances.EuclideanConstructor() 
     7d2Constr = Orange.distance.Euclidean() 
    88d2 = d2Constr(iris) 
    99 
    1010# Constructs  
    11 dPears = Orange.distance.instances.PearsonRConstructor(iris) 
     11dPears = Orange.distance.PearsonR(iris) 
    1212 
    1313#reference instance 
  • docs/reference/rst/code/outlier2.py

    r9823 r9889  
    33bridges = Orange.data.Table("bridges") 
    44outlier_det = Orange.preprocess.outliers.OutlierDetection() 
    5 outlier_det.set_examples(bridges, Orange.distance.instances.EuclideanConstructor(bridges)) 
     5outlier_det.set_examples(bridges, Orange.distance.Euclidean(bridges)) 
    66outlier_det.set_knn(3) 
    77z_values = outlier_det.z_values() 
  • docs/reference/rst/code/svm-custom-kernel.py

    r9823 r9889  
    33 
    44from Orange.classification.svm import SVMLearner, kernels 
    5 from Orange.distance.instances import EuclideanConstructor 
    6 from Orange.distance.instances import HammingConstructor 
     5from Orange.distance import Euclidean 
     6from Orange.distance import Hamming 
    77 
    88iris = data.Table("iris.tab") 
    99l1 = SVMLearner() 
    10 l1.kernel_func = kernels.RBFKernelWrapper(EuclideanConstructor(iris), gamma=0.5) 
     10l1.kernel_func = kernels.RBFKernelWrapper(Euclidean(iris), gamma=0.5) 
    1111l1.kernel_type = SVMLearner.Custom 
    1212l1.probability = True 
     
    1515 
    1616l2 = SVMLearner() 
    17 l2.kernel_func = kernels.RBFKernelWrapper(HammingConstructor(iris), gamma=0.5) 
     17l2.kernel_func = kernels.RBFKernelWrapper(Hamming(iris), gamma=0.5) 
    1818l2.kernel_type = SVMLearner.Custom 
    1919l2.probability = True 
     
    2323l3 = SVMLearner() 
    2424l3.kernel_func = kernels.CompositeKernelWrapper( 
    25     kernels.RBFKernelWrapper(EuclideanConstructor(iris), gamma=0.5), 
    26     kernels.RBFKernelWrapper(HammingConstructor(iris), gamma=0.5), l=0.5) 
     25    kernels.RBFKernelWrapper(Euclidean(iris), gamma=0.5), 
     26    kernels.RBFKernelWrapper(Hamming(iris), gamma=0.5), l=0.5) 
    2727l3.kernel_type = SVMLearner.Custom 
    2828l3.probability = True 
Note: See TracChangeset for help on using the changeset viewer.