source: orange/orange/doc/modules/logreg1.py @ 7652:677f449144fd

Revision 7652:677f449144fd, 431 bytes checked in by ales_erjavec <ales.erjavec@…>, 3 years ago (diff)
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.