#
source:
orange/docs/widgets/rst/unsupervized/mds.rst
@
11050:e3c4699ca155

Revision 11050:e3c4699ca155, 5.9 KB checked in by Miha Stajdohar <miha.stajdohar@…>, 16 months ago (diff) |
---|

Line | |
---|---|

1 | .. _MDS: |

2 | |

3 | MDS |

4 | === |

5 | |

6 | .. image:: ../icons/MDS.png |

7 | |

8 | Multidimensional scaling (MDS) - a projection into a plane fitted to the given distances between the points |

9 | |

10 | Signals |

11 | ------- |

12 | |

13 | Inputs: |

14 | - Distance Matrix |

15 | A matrix of (desired) distances between points |

16 | - Example Subset (ExampleTable) |

17 | A subset of examples to be marked in the graph |

18 | |

19 | |

20 | Outputs: |

21 | - Selected Examples |

22 | A table of selected examples |

23 | - Structured Data Files |

24 | ??? |

25 | |

26 | |

27 | Signals Example Subset and Selected Examples are only applicable if Distance Matrix describes distances between examples, for instance if the matrix comes from `Example Distance <ExampleDistance.htm>`_. |

28 | |

29 | Description |

30 | ----------- |

31 | |

32 | Multidimensional scaling is a technique which finds a low-dimensional (in our case a two-dimensional) projection of points, where it tries to fit the given distances between points as well is possible. The perfect fit is typically impossible to obtain since the data is higher dimensional or the distances are not Euclidean. |

33 | |

34 | To do its work, the widget needs a matrix of distances. The distances can correspond to any kinds of object. However, the widget has some functionality dedicated to distances between examples, such as coloring the points and changing their shapes, marking them, and outputting them upon selection. |

35 | |

36 | The algorithm iteratively moves the points around in a kind of simulation of a physical model: if two points are too close to each other (or too far away), there is a force pushing them apart (together). The change of the point's position at each time interval corresponds to the sum of forces acting on it. |

37 | |

38 | .. image:: images/MDS.png |

39 | |

40 | The first group of buttons set the position of points. :obj:`Randomize` sets the to a random position; the initial positions are also random. :obj:`Jitter` randomly moves the points for a short distance; this may be useful if the optimization is stuck in a (seemingly) local minimum. :obj:`Torgerson` positions the points using Torgerson's method. |

41 | |

42 | Optimization is run by pushing :obj:`Optimize`. :obj:`Single Step` makes a single step of optimization; this is primarily useful for educative purposes. |

43 | |

44 | Stress function defines how the difference between the desired and the actual distance between points translates into the forces acting on them. Several are available. Let current and desired be the distance in the current projection and the desired distances, and diff=current-desired. Then the stress functions are defined as follows: |

45 | |

46 | - :obj:`Kruskal stress`: diff<sup>2</sup> |

47 | - :obj:`Sammon stress`: diff<sup>2</sup>/current |

48 | - :obj:`Signed Sammon stress`: diff/current |

49 | - :obj:`Signed relative stress`: diff/desired |

50 | |

51 | |

52 | |

53 | The widget redraws the projection during optimization. It can do so at :obj:`Every step`, :obj:`Every 10 steps` or :obj:`Every 100 steps`. Setting a lower refresh interval makes the animation more visually appealing, but can be slow if the number of points is high. |

54 | |

55 | The optimization stops either when the projection changes only minimally at the last iteration or when a specified number of steps have been made. The two conditions are given with options :obj:`Minimal average stress change` and :obj:`Maximal number of steps`. |

56 | |

57 | The bottom of the settings pane shows the average stress (the lower the better) and the number of steps made in the last optimization. |

58 | |

59 | <img class="leftscreenshot" src="MDS-Graph.png" border=0 /> |

60 | |

61 | The second tab with settings defines how the points are visualized and the settings related to outputting the data. The user can set the size of points (:obj:`Point Size`) or let the size depend on the value of some continuous attribute (:obj:`Size`) of the example the point represents. The color and shape of the point (:obj:`Color`, :obj:`Shape`) can depend upon values of discrete attributes. Any attribute can serve as a label. |

62 | |

63 | These options are only active if the points represents examples (that is, if there is a table of examples attached to the distance matrix on the widget's input). If the points represent attributes (e.g. the distance matrix comes from `Attribute Distance <AttributeDistance.htm>`_), the points can be labeled by attribute names. If the points come from a labeled distance file (see `Distance File <DistanceFile.htm>`_), the labels can be used for annotating the points. |

64 | |

65 | The widget can superimpose a graph onto the projection, where the specified proportion of the most similar pairs is connected, with the width of connection showing the similarity. This is enabled by checking :obj:`Show similar pairs` and setting the proportion of connected pairs below. Enabling this option during the optimization can illustrate how the algorithm works, though drawing too many connections at each refresh can make the optimization very slow. The picture below shows a rendering of the zoo data set with this option enable. |

66 | |

67 | .. image:: images/MSD-Connected.png |

68 | |

69 | The remaining options deal with zooming selecting the points and sending them on. The magnifying glass enables zooming, and the other two icons enable selection of examples with rectangular or arbitrary selection areas. The buttons in the left group undo the last action, remove all selection and send the selected examples. Sending the examples can be automatic if :obj:`Auto send selected` is checked. |

70 | |

71 | The output data can have the coordinates of each point appended, either as normal attributes (:obj:`Append coordinates`) or as meta attributes (:obj:`Append coordinates as meta`). |

72 | |

73 | The MDS graph performs many of the functions of the visualizations widget. It is in many respects similar to the `Scatter Plot <../Visuzalize/ScatterPlot.htm>`_, so we recommend reading its description as well. |

74 | |

75 | Examples |

76 | -------- |

77 | |

78 | The above graphs were drawn using the following simple schema. |

79 | |

80 | .. image:: images/MDS-Schema.png |

81 | |

82 | Interactive functions of the MDS widget - marking subsets of examples, selecting examples, etc. - are similar to those of the `Scatter Plot <../Visuzalize/ScatterPlot.htm>`_ widget, so see its documentation for more examples. |

**Note:**See TracBrowser for help on using the repository browser.