source: orange/docs/reference/rst/code/som-classifier.py @ 9823:7f9c3f3c6474

Revision 9823:7f9c3f3c6474, 464 bytes checked in by lanumek, 2 years ago (diff)

Changed names of data sets (table replaced with data or name of the data set).

Line 
1# Description: Self Organizing Maps on iris data set
2# Category:    projection
3# Uses:        iris
4# Referenced:  Orange.projection.som
5# Classes:     Orange.projection.som.SOMLearner
6
7import Orange
8import random
9learner = Orange.projection.som.SOMSupervisedLearner(map_shape=(4, 4))
10iris = Orange.data.Table("iris.tab")
11classifier = learner(iris)
12random.seed(50)
13for d in random.sample(iris, 5):
14    print "%-15s originally %-15s" % (classifier(d), d.getclass())
Note: See TracBrowser for help on using the repository browser.