Ticket #1322: example.py

File example.py, 417 bytes (added by matthijss, 13 months ago)
Line 
1import Orange.feature
2import Orange.data
3import Orange.associate
4import numpy as np
5
6data = np.round(np.random.rand(20,2)).astype(int)
7data[ data == 0 ] = -1
8names = ['c1', 'c2']
9features = [Orange.feature.Discrete(name,values=['-1','1']) for name in names]
10domain = Orange.data.Domain(features)
11table = Orange.data.Table(domain, data)
12
13rules = Orange.associate.AssociationRulesInducer(table, support=0.3)