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

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

Widget docs From HTML to Sphinx.

Line 
1.. _Distance File:
2
3Distance File
4=============
5
6.. image:: ../icons/DistanceFile.png
7
8Computes distances between examples in the data set
9
10Signals
11-------
12
13Inputs:
14   - Examples
15      A list of examples
16
17
18Outputs:
19   - Distance Matrix
20      A matrix of example distances
21
22
23Description
24-----------
25
26Loads a distance matrix from a text file.
27
28The first line in the file has to start with the number of items - the dimension of the matrix. It can be followed by the word labeled or labelled if the file also contains the labels for the items. The rest of the file is the matrix, where the elements are separated by tabulators. If the items are labelled, the label has to be put in front of each line. The matrix can be given with the lower or the upper part, or both. Here are two examples.
29
300.1
310.5    0.3
320.7    0.9    0.2
330.2    0.8    0.6    0.5
34
35john   0.1
36joe    0.5    0.3
37jack   0.7    0.9    0.2
38jane   0.2    0.8    0.6    0.5
39
40.. image:: images/DistanceFile.png
41   :alt: Distance File Widget
42
43The file is selected using button :obj:`...`, which opens a file browser. File extension is arbitrary.
44
45Sometimes we get the labels in a separate example table. Say that we have a set of 15 examples in a data file, and the distance matrix represents distances between these examples. In this case, we would connect the widget providing these 15 examples (say a `File widget <../Data/File.htm>`_) to the input of Distance File and select :obj:`Use examples as items` in Items from input data. Distance File would attach the examples to the distance matrix, so further widget can, for instance, use a user-selected attribute to label the items.
46
47In another scenario, the distance matrix would represent distances between attributes of some data table. We similarly connect a data providing widget to Distance File, but select :obj:`Use attribute names`. Distance File then labels the items with the names of the attributes.
48
49Examples
50--------
51
52The first schema loads the labelled distance file above and shows it with the `Distance Map widget <DistanceMap.htm>`_.
53
54.. image:: images/DistanceFile1-Schema.png
55
56.. image:: images/DistanceFile-DistanceMap1.png
57
58In the second schema the labels come from a file. The labels given in the file loaded by Distance File are replaced by the attribute names (since we checked :obj:`Use attribute names`.
59
60.. image:: images/DistanceFile2-Schema.png
61
62In the file widget we loaded the Iris data set, and the resulting distance map looks like this.
63
64.. image:: images/DistanceFile-DistanceMap2.png
65
66The widget can of course be connected to any other widget that can do something useful with the distances, such as `MDS <MDS.htm>`_ or `Hierarchical Clustering <HiearchicalClustering.htm>`_.
Note: See TracBrowser for help on using the repository browser.