Changeset 7220:4dbccb58ea86 in orange


Ignore:
Timestamp:
02/02/11 18:17:04 (3 years ago)
Author:
miha <miha.stajdohar@…>
Branch:
default
Convert:
aaaa7c4b7e1e4c84e6c12a3a6ff6c1666835c362
Message:
 
Location:
orange/doc/Orange/rst/code
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orange/doc/Orange/rst/code/svm-custom-kernel.py

    r7130 r7220  
    1 import orange, orngSVM 
    2 data=orange.ExampleTable("iris.tab") 
    3 l1=orngSVM.SVMLearner() 
    4 l1.kernelFunc=orngSVM.RBFKernelWrapper(orange.ExamplesDistanceConstructor_Euclidean(data), gamma=0.5) 
    5 l1.kernel_type=orange.SVMLearner.Custom 
     1from Orange import core 
     2from Orange.classification import svm 
     3 
     4data=core.ExampleTable("iris.tab") 
     5l1=svm.SVMLearner() 
     6l1.kernelFunc=svm.kernels.RBFKernelWrapper(core.ExamplesDistanceConstructor_Euclidean(data), gamma=0.5) 
     7l1.kernel_type=svm.SVMLearner.Custom 
    68l1.probability=True 
    79c1=l1(data) 
    810l1.name="SVM - RBF(Euclidean)" 
    911 
    10 l2=orngSVM.SVMLearner() 
    11 l2.kernelFunc=orngSVM.RBFKernelWrapper(orange.ExamplesDistanceConstructor_Hamming(data), gamma=0.5) 
    12 l2.kernel_type=orange.SVMLearner.Custom 
     12l2=svm.SVMLearner() 
     13l2.kernelFunc=svm.kernels.RBFKernelWrapper( 
     14    core.ExamplesDistanceConstructor_Hamming(data), gamma=0.5) 
     15l2.kernel_type=svm.SVMLearner.Custom 
    1316l2.probability=True 
    1417c2=l2(data) 
    1518l2.name="SVM - RBF(Hamming)" 
    1619 
    17 l3=orngSVM.SVMLearner() 
    18 l3.kernelFunc=orngSVM.CompositeKernelWrapper(orngSVM.RBFKernelWrapper(orange.ExamplesDistanceConstructor_Euclidean(data), gamma=0.5),orngSVM.RBFKernelWrapper(orange.ExamplesDistanceConstructor_Hamming(data), gamma=0.5), l=0.5) 
    19 l3.kernel_type=orange.SVMLearner.Custom 
     20l3=svm.SVMLearner() 
     21l3.kernelFunc = svm.kernels.CompositeKernelWrapper( 
     22    svm.kernels.RBFKernelWrapper( 
     23    core.ExamplesDistanceConstructor_Euclidean(data), gamma=0.5), 
     24    svm.kernels.RBFKernelWrapper( 
     25    core.ExamplesDistanceConstructor_Hamming(data), gamma=0.5), l=0.5) 
     26l3.kernel_type=svm.SVMLearner.Custom 
    2027l3.probability=True 
    2128c3=l1(data) 
  • orange/doc/Orange/rst/code/svm-easy.py

    r7130 r7220  
    1 import orange 
    2 import Orange.classify.svm as svm 
     1from Orange import core 
     2from Orange.classification import svm 
    33 
    4 data = orange.ExampleTable("vehicle.tab") 
     4data = core.ExampleTable("vehicle.tab") 
    55 
    66svm_easy = svm.SVMLearnerEasy(name="svm easy", folds=3) 
  • orange/doc/Orange/rst/code/svm-linear-weights.py

    r7130 r7220  
    1 import orange 
    2 import Orange.classify.svm as svm 
     1from Orange import core  
     2from Orange.classification import svm 
    33 
    4 data = orange.ExampleTable("brown-selected") 
    5 classifier = svm.SVMLearner(data, kernel_type=svm.Linear, normalization=False) 
     4data = core.ExampleTable("brown-selected") 
     5classifier = svm.SVMLearner(data, kernel_type=svm.kernels.Linear, normalization=False) 
    66 
    77weights = svm.getLinearSVMWeights(classifier) 
  • orange/doc/Orange/rst/code/svm-recursive-feature-elimination.py

    r7130 r7220  
    1 import orange 
    2 import Orange.classify.svm as svm 
     1from Orange import core 
     2from Orange.classification import svm 
    33 
    4 data = orange.ExampleTable("brown-selected") 
     4data = core.ExampleTable("brown-selected") 
    55print data.domain 
    66 
Note: See TracChangeset for help on using the changeset viewer.