Orange Forum • View topic - some examples don't work

some examples don't work

Report bugs (or imagined bugs).
(Archived/read-only, please use our ticketing system for reporting bugs and their discussion.)
Forum rules
Archived/read-only, please use our ticketing system for reporting bugs and their discussion.

some examples don't work

Postby michael.hecht » Sat Feb 06, 2010 19:20

Example doesn't work:
Code: Select all
import orange, orngTest, orngStat, orngEnsemble
data = orange.ExampleTable("promoters")

majority = orange.MajorityLearner() = "default"
knn = orange.kNNLearner(k=11) = "k-NN (k=11)"

bagged_knn = orngEnsemble.BaggedLearner(knn, t=10) = "bagged k-NN"
boosted_knn = orngEnsemble.BoostedLearner(knn, t=10) = "boosted k-NN"

learners = [majority, knn, bagged_knn, boosted_knn]
results = orngTest.crossValidation(learners, data, folds=10)
print "        Learner   CA     Brier Score"
for i in range(len(learners)):
    print ("%15s:  %5.3f  %5.3f") % (learners[i].name,
        orngStat.CA(results)[i], orngStat.BrierScore(results)[i])

results in :
Code: Select all
Traceback (most recent call last):
  File "C:\temp\", line 17, in <module>
    results = orngTest.crossValidation(learners, data, folds=3)
  File "C:\Python25\lib\site-packages\orange\", line 184, in crossValidation
    return testWithIndices(learners, (examples, weight), indices, indicesrandseed, pps, **argkw)
  File "C:\Python25\lib\site-packages\orange\", line 402, in testWithIndices
    cr = classifiers[cl](ex, orange.GetBoth)                                     
  File "C:\Python25\lib\site-packages\orange\", line 70, in __call__
    votes = [0.] * len(self.classvar.values)
AttributeError: 'BoostedClassifier' has no attribute 'classvar'

What now?

Seems to be fixed

Postby michael.hecht » Sat Feb 06, 2010 20:08

It's really funny, but it seems to be fixed within the last weeks, since the current snapshot doesn't have the bug.

Return to Bugs