Trees | Indices | Help |
|
---|
|
1 import cPickle as pickle 2 f=open('classifier.clsf') 3 classifier = pickle.load(f) 4 f.close() 5 weights_aligned = zip(classifier.__dict__['domain'],classifier.__dict__['weights'][0]) 6 weights_sorted = sorted(weights_aligned, key=lambda x: -abs(x[1])) 7 w=open('classifier.weights','w') 8 9 for feature, weight in weights_sorted: 10 w.write('{}\t{}\n'.format(feature.name, weight)) 11 12 w.close() 13
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Jul 18 11:46:17 2014 | http://epydoc.sourceforge.net |