source: orange/Orange/doc/modules/orngSOM.htm @ 9671:a7b056375472

Revision 9671:a7b056375472, 2.4 KB checked in by anze <anze.staric@…>, 2 years ago (diff)

Moved orange to Orange (part 2)

Line 
1<html>
2<head>
3<link rel=stylesheet href="../style.css" type="text/css" media=screen>
4</head>
5<body>
6<h1>orngSOM</h1>
7<p>orngSOM module contains an implementation of the Self Organizing Map (also known as Kohonen map) algorithm<p>
8<h2>SOMLearner</h2>
9<p>SOMLearner is a class used to train the SOM on the training data</p>
10<p class=section >Arguments</p>
11<dl class=arguments>
12  <dt>map_shape</dt>
13  <dd>A tuple containing the width and height of the map (default (5, 10))</dd>
14  <dt>initialize</dt>
15  <dd>Specifies one of the two ways the map is initialized, InitializeLinear (default) or InitializeRandom</dd>
16  <dt>neighbourhood</dt>
17  <dd>Specifies one of the two map neighbourhood types, NeighbourhoodGaussian (default) or NeighbourhoodBubble</dd>
18  <dt>topology</dt>
19  <dd>Specifies one of the two map topology types, HexagonalTopology (default) or RectangularTopology</dd>
20  <dt>radius_ini</dt>
21  <dd>The start radius (default 3)</dd>
22  <dt>radius_fin</dt>
23  <dd>The final radius (default 1)</dd>
24  <dt>epochs</dt>
25  <dd>The number of training iterations</dd>
26</dl>
27
28<h2>SOMSupervisedLearner</h2>
29<p>SOMSupervisedLearner is a class used to learn SOM from orange.ExampleTable, by using the
30class information in the learning process. This is achieved by adding a value for each class
31to the training instances, where 1.0 signals class membership and all other values are 0.0.
32After the training, the new values are discarded from the node vectors. Otherwise it behaves
33just like the SOMLearner.</p>
34
35<h2>SOMMap</h2>
36<p>SOMMap contains the resulting trained map</p>
37<p class=section >Methods</p>
38<dl class=attributes>
39  <dt>getBestMatchingNode(example)</dt>
40  <dd>Return the node closest to the example</dd>
41  <dt>__call__(example)</dt>
42  <dd>Predict the class of the example by finding the best matching node of the example and classify
43  it to the majority class of all training instances mapped to this node (only works if the class information
44  is present in the learning data)</dd>
45  <dt>__getitem__(i, j)</dt>
46  <dd>Return the node in the i-th row and i-th column (e.g. map[1, 3])</dd>
47  <dt>__iter__()</dt>
48  <dd>Return an iterator over all the nodes</dd>
49</dl>
50
51<h2>Example</h2>
52
53<xmp class=code>>>> som = orngSOM.SOMLearner(map_shape=(10, 20), initialize=orngSOM.InitializeRandom)
54>>> map = som(orange.ExampleTable("iris.tab"))
55>>> for n in map:
56>>>     print "node:", n.pos[0], n.pos[1]
57>>>     for e in n.examples:
58>>>         print "\t",e
59</xmp>
Note: See TracBrowser for help on using the repository browser.