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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.