source: orange/Orange/testing/regression/tests_20/modules_pade.py @ 9952:986e9cd806f4

Revision 9952:986e9cd806f4, 1.3 KB checked in by Miha Stajdohar <miha.stajdohar@…>, 2 years ago (diff)

Tests moved and renamed from orange 20.

Line 
1import orange, orngPade, orngTree
2reload(orngPade)
3
4#data = orange.ExampleTable("c:\\d\\x2.txt")
5data = orange.ExampleTable("c:\\D\\ai\\Orange\\test\\squin\\xyz-t")
6##pa, cid, did = orngPade.pade(data, [0, 2], orngPade.tubedRegression)
7##print pa[0]
8##
9##pa, cid, did = orngPade.pade(data, [0, 2], orngPade.tubedRegression, derivativeAsMeta=1, outputAttr=1)
10##print pa[0]
11##
12##pa, cid, did = orngPade.pade(data, [0, 2], orngPade.tubedRegression, derivativeAsMeta=1, differencesAsMeta=1, originalAsMeta=1, outputAttr=1)
13##print pa[0]
14##
15##pa, cid, did = orngPade.pade(data, [0, 2], orngPade.tubedRegression, derivativeAsMeta=1, originalAsMeta=1)
16##print pa[0]
17##
18
19
20## Testiranje na ucnih podatkih
21
22pa, qid, did, cid = orngPade.pade(data, [2], orngPade.firstTriangle, originalAsMeta=True)
23tree = orngTree.TreeLearner(pa, maxDepth=4)
24orngTree.printTxt(tree)
25
26print orngPade.computeAmbiguityAccuracy(tree, pa, cid)
27
28
29
30## Precno preverjanje
31
32cv = orange.MakeRandomIndicesCV(data, 10)
33amb = acc = 0.0
34for fold in range(10):
35    train = data.select(cv, fold, negate=1)
36    test = data.select(cv, fold)
37    pa, qid, did, cid = orngPade.pade(train, [0, 2], originalAsMeta=True)
38    tree = orngTree.TreeLearner(pa, maxDepth=4)
39
40    mb, cc = orngPade.computeAmbiguityAccuracy(tree, test, -1)
41    amb += mb
42    acc += cc
43    print (mb, cc)
44print amb/10, acc/10
45
Note: See TracBrowser for help on using the repository browser.