source: orange/Orange/doc/modules/logreg1.py @ 9671:a7b056375472

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

Moved orange to Orange (part 2)

Line 
1# Description: Demonstrates the use of logistic regression
2# Category:    classification, logistic regression
3# Classes:     LogRegLearner
4# Uses:        titanic.tab
5
6import orange
7import orngLR
8
9data = orange.ExampleTable("titanic")
10lr = orngLR.LogRegLearner(data) 
11
12correct = 0
13for ex in data:
14    if lr(ex) == ex.getclass():
15        correct += 1
16       
17print "Classification accuracy:", correct/len(data)
18orngLR.printOUT(lr) 
Note: See TracBrowser for help on using the repository browser.