source: orange/docs/widgets/rst/data/mergedata.rst @ 11778:ecd4beec2099

Revision 11778:ecd4beec2099, 3.7 KB checked in by Ales Erjavec <ales.erjavec@…>, 5 months ago (diff)

Use new SVG icons in the widget documentation.

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