source: orange/Orange/testing/regression/tests_20/modules_logreg1.py @ 9952:986e9cd806f4

Revision 9952:986e9cd806f4, 431 bytes checked in by Miha Stajdohar <miha.stajdohar@…>, 2 years ago (diff)

Tests moved and renamed from orange 20.

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.