Revision 9671:a7b056375472, 1.3 KB checked in by anze <anze.staric@…>, 2 years ago (diff)

Moved orange to Orange (part 2)

Line
1import orange, orngPade, orngTree
3
4#data = orange.ExampleTable("c:\\d\\x2.txt")
5data = orange.ExampleTable("c:\\D\\ai\\Orange\\test\\squin\\xyz-t")
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
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.