Changeset 8991:257da7e49cb0 in orange


Ignore:
Timestamp:
09/20/11 14:05:57 (3 years ago)
Author:
miha <miha.stajdohar@…>
Branch:
default
Convert:
a29adffd537ad230afb2d0f418f0e13dd0ae7cd1
Message:

Converted to Orange25.

Location:
orange/doc/Orange/rst/code
Files:
2 edited

Legend:

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

    r8042 r8991  
    55table = data.Table("iris.tab") 
    66l1=svm.SVMLearner() 
    7 l1.kernelFunc=svm.kernels.RBFKernelWrapper(core.ExamplesDistanceConstructor_Euclidean(table), gamma=0.5) 
     7l1.kernel_func=svm.kernels.RBFKernelWrapper(core.ExamplesDistanceConstructor_Euclidean(table), gamma=0.5) 
    88l1.kernel_type=svm.SVMLearner.Custom 
    99l1.probability=True 
     
    1212 
    1313l2=svm.SVMLearner() 
    14 l2.kernelFunc=svm.kernels.RBFKernelWrapper( 
     14l2.kernel_func=svm.kernels.RBFKernelWrapper( 
    1515    core.ExamplesDistanceConstructor_Hamming(table), gamma=0.5) 
    1616l2.kernel_type=svm.SVMLearner.Custom 
     
    2020 
    2121l3=svm.SVMLearner() 
    22 l3.kernelFunc = svm.kernels.CompositeKernelWrapper( 
     22l3.kernel_func = svm.kernels.CompositeKernelWrapper( 
    2323    svm.kernels.RBFKernelWrapper( 
    2424    core.ExamplesDistanceConstructor_Euclidean(table), gamma=0.5), 
     
    2929c3=l1(table) 
    3030l3.name="SVM - Composite" 
    31  
    32  
    33 import orngTest, orngStat 
    34 tests=orngTest.crossValidation([l1, l2, l3], table, folds=5) 
    35 [ca1, ca2, ca3]=orngStat.CA(tests) 
     31         
     32from Orange import evaluation 
     33tests = evaluation.testing.cross_validation([l1, l2, l3], table, folds=5) 
     34[ca1, ca2, ca3]=evaluation.scoring.CA(tests) 
    3635print l1.name, "CA:", ca1 
    3736print l2.name, "CA:", ca2 
  • orange/doc/Orange/rst/code/svm-easy.py

    r8042 r8991  
    88learners = [svm_easy, svm_normal] 
    99 
    10 import orngStat, orngTest 
     10from Orange import evaluation 
    1111 
    12 results = orngTest.crossValidation(learners, table, folds=5) 
     12results = evaluation.testing.cross_validation(learners, table, folds=5) 
    1313print "Name     CA        AUC" 
    14 for learner, CA, AUC in zip(learners, orngStat.CA(results), orngStat.AUC(results)): 
     14for learner, CA, AUC in zip(learners, evaluation.scoring.CA(results), evaluation.scoring.AUC(results)): 
    1515    print "%-8s %.2f      %.2f" % (learner.name, CA, AUC) 
    16  
Note: See TracChangeset for help on using the changeset viewer.