Changeset 9449:7a5ec4bc7f65 in orange


Ignore:
Timestamp:
07/04/11 17:55:34 (3 years ago)
Author:
wencanluo <wencanluo@…>
Branch:
default
Convert:
f94ed16b2d07cae0bdd36421fe6b572f0e5e4997
Message:

Update widget Test for multi-label

Location:
orange
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orange/Orange/__init__.py

    r9447 r9449  
    8989_import("multilabel.multibase") 
    9090_import("multilabel.br") 
    91 _import("multilabel.testing") 
    92 _import("multilabel.scoring") 
    9391 
     92 
  • orange/OrangeWidgets/Multilabel/OWTestLearners.py

    r9448 r9449  
    280280        learners = [] 
    281281        n = len(self.data.domain.attributes)*2 
     282        print n 
     283        print len(self.data) 
    282284        indices = orange.MakeRandomIndices2(p0=min(n, len(self.data)), stratified=orange.MakeRandomIndices2.StratifiedIfPossible) 
    283         print indices 
    284    
     285 
    285286        new = self.data 
    286 #        new = self.data.selectref(indices(self.data)) 
     287#         new = self.data.selectref(indices(self.data)) 
    287288#        new = self.data.selectref([1]*min(n, len(self.data)) + 
    288289#                                  [0]*(len(self.data) - min(n, len(self.data)))) 
     
    307308                else:                   #multi-label 
    308309                    learners.append(learner) 
     310                    print "multi-learner" 
    309311            except Exception, ex: 
    310312                self.warning(0, "Learner %s ends with exception: %s" % (l.name, str(ex))) 
     
    579581 
    580582    data1 = orange.ExampleTable(r'../../doc/datasets/multidata') 
    581     data2 = orange.ExampleTable(r'../../doc/datasets/glass') 
     583    data2 = orange.ExampleTable(r'../../doc/datasets/voting') 
    582584    datar = orange.ExampleTable(r'../../doc/datasets/adult') 
    583585    data3 = orange.ExampleTable(r'../../doc/datasets/balance-scale') 
  • orange/doc/Orange/rst/code/mlc-evaluator.py

    r9447 r9449  
    55data = Orange.data.Table("multidata") 
    66 
    7 res = Orange.evaluation.testing.cross_validation(learners, data) 
     7res = Orange.evaluation.testing.cross_validation(learners, data, folds=10, strat=Orange.core.MakeRandomIndices.StratifiedIfPossible) 
     8 
     9#res = Orange.evaluation.testing.cross_validation(learners, data) 
    810 
    911loss = Orange.evaluation.scoring.hamming_loss(res) 
Note: See TracChangeset for help on using the changeset viewer.