source: orange/docs/reference/rst/code/logreg-run.py @ 9638:eb3af38491f2

Revision 9638:eb3af38491f2, 327 bytes checked in by umek@…, 2 years ago (diff)

Changed table to data or name of the data set.

For example - instead of

table = Orange.data.Table("housing")

is changed to

housing = Orange.data.Table("housing")

Line 
1import Orange
2
3titanic = Orange.data.Table("titanic")
4lr = Orange.classification.logreg.LogRegLearner(titanic)
5
6# compute classification accuracy
7correct = 0.0
8for ex in titanic:
9    if lr(ex) == ex.getclass():
10        correct += 1
11print "Classification accuracy:", correct / len(titanic)
12Orange.classification.logreg.dump(lr)
Note: See TracBrowser for help on using the repository browser.