source: orange/orange/doc/reference/linear-learner.py @ 6419:f55c8b814531

Revision 6419:f55c8b814531, 353 bytes checked in by ales_erjavec <ales.erjavec@…>, 4 years ago (diff)
  • added linear-learner.py
  • added a link from SupportVectorMachines to LinearLearner
Line 
1import orange
2
3data = orange.ExampleTable("iris")
4classifier = orange.LinearLearner(data)
5
6for i, cls_name in enumerate(data.domain.classVar.values):
7    print "Attribute weights for %s vs. rest classification:\n\t" % cls_name,
8    for attr, w in  zip(data.domain.attributes, classifier.weights[i]):
9        print "%s: %.3f " % (attr.name, w),
10    print
Note: See TracBrowser for help on using the repository browser.