source: orange/docs/widgets/rst/data/mergedata.rst @ 11050:e3c4699ca155

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

Widget docs From HTML to Sphinx.

Line 
1.. _Merge Data:
2
3Merge Data
4==========
5
6.. image:: ../icons/MergeData.png
7
8Merges two data sets based on the values of selected attributes.
9
10Signals
11-------
12
13Inputs:
14
15
16   - Examples A (ExampleTable)
17      Attribute-valued data set.
18   - Examples B (ExampleTable)
19      Attribute-valued data set.
20
21
22Outputs:
23
24
25   - Merged Examples A+B (ExampleTable)
26      Attribute-valued data set composed from instances from input data A which are appended attributes from input data B and their values determined by matching the values of the selected attributes.
27   - Merged Examples B+A (ExampleTable)
28      Attribute-valued data set composed from instances from input data B which are appended attributes from input data A and their values determined by matching the values of the selected attributes.
29
30
31Description
32-----------
33
34Merge Data widget is used to horizontally merge two data sets based on the values of selected attributes. On input, two data sets are required, A and B. The widget allows for selection of an attribute from each domain which will be used to perform the merging. When selected, the widget produces two outputs, A+B and B+A. The first output (A+B) corresponds to instances from input data A which are appended attributes from B, and the second output (B+A) to instances from B which are appended attributes from A.
35
36The merging is done by the values of the selected (merging) attributes. For example, instances from from A+B are constructed in the following way. First, the value of the merging attribute from A is taken and instances from B are searched with matching values of the merging attributes. If more than a single instance from B is found, the first one is taken and horizontally merged with the instance from A. If no instance from B match the criterium, the unknown values are assigned to the appended attributes. Similarly, B+A is constructed.
37
38.. image:: images/MergeData1.png
39   :alt: Merge Data
40
41Examples
42--------
43
44Below is an example that loads spot intensity data from microarray measurements and spot annotation data. While microarray data consists of measurements of several spots representing equal DNA material (denoted by equal :obj:`Spot ID's`), the annotation data consists of a single line (instance) for each spot.
45
46Merging the two data sets results in annotations appended to each spot intensity datum. The :obj:`Spot intensities` data is connected to :obj:`Examples A` input of the :obj:`Merge Data` widget, and the :obj:`Spot annotations` data to the :obj:`Examples B` input. Both outputs of the :obj:`Merge Data` widget are then connected to the :obj:`Data Table` widget. In the latter, the :obj:`Merged Examples A+B` are shown. The attributes between :obj:`Spot ID` and :obj:`BG {Ref}`, including these two, are from the :obj:`Spot intensities` data set (:obj:`Examples A`), while the last three are from the :obj:`Spot annotations` data set (:obj:`Examples B`). Only instances representing non-control DNA (these with :obj:`Spot ID` equal to :obj:`ST_Hs_???`) received annotations, while for the others (:obj:`Spot ID = ST_Cr_048`), no annotation data exists in the :obj:`Spot annotations` data and unknown values were assigned to the appended attributes.
47
48.. image:: images/MergeData2s.png
49   :alt: Schema with Merge Data
50
51Hint
52----
53
54If the two data sets consists of equally-named attributes (others than the ones used to perform the merging), Orange will by default check for consistency of the values of these attributes and report an error in case of non-matching values. In order to avoid the consistency checking, make sure that new attributes are created for each data set: you may use "... Always create a new attribute" option in the `File <File.htm>`_ widget for loading the data.
Note: See TracBrowser for help on using the repository browser.