Skip to content

[DOC] Pivot Table#3825

Merged
janezd merged 2 commits into
biolab:masterfrom
ajdapretnar:pivot-docs
May 31, 2019
Merged

[DOC] Pivot Table#3825
janezd merged 2 commits into
biolab:masterfrom
ajdapretnar:pivot-docs

Conversation

@ajdapretnar
Copy link
Copy Markdown
Contributor

Issue

Pivot Table needs docs.
#3823

Description of changes

Add documentation for the widget.

Includes
  • Code changes
  • Tests
  • Documentation

@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2019

Codecov Report

Merging #3825 into master will increase coverage by 0.16%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #3825      +/-   ##
==========================================
+ Coverage   84.76%   84.93%   +0.16%     
==========================================
  Files         374      376       +2     
  Lines       69172    70136     +964     
==========================================
+ Hits        58637    59571     +934     
- Misses      10535    10565      +30


**Outputs**

- Pivot Table: contingency matrix as set in the widget
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... as showed? as seen? showed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shown :)


- Pivot Table: contingency matrix as set in the widget
- Filtered Data: subset selected from the plot
- Grouped Data: data table grouped by row values
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe - Grouped Data: aggregates over groups defined by row values?

- Filtered Data: subset selected from the plot
- Grouped Data: data table grouped by row values

**Pivot Table** summarizes the data of a more extensive table into a table of statistics. The statistics can include sums, averages, counts, etc. The widget also allows selecting a subset from the plot and grouping by row values, which have to be a discrete variable. Data with only numeric variables cannot be displayed in the plot.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plot? Probably table? (This appears twice.)


![](images/Pivot-stamped.png)

1. Discrete or numeric variable that will be used for row values. Numeric variables are considered as integers in this case. Variable values will appear as rows in the table.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last sentence is perhaps redundant. You can also remove "in this case." Also perhaps that will be.


1. Discrete or numeric variable that will be used for row values. Numeric variables are considered as integers in this case. Variable values will appear as rows in the table.
2. Discrete variable that will be used for column values. Variable values will appear as columns in the table.
3. Values that will be used for aggregation. Aggregated values will appear as cells in the table.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider removing that will be; also above.

3. Values that will be used for aggregation. Aggregated values will appear as cells in the table.
4. Aggregation methods:
- For any variable type:
- *Count*: number of instances that appear in the data
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- *Count*: size of the group, that is, the number of instances with the given row and column value.

I'm not totally sure this is better, though. :)

4. Aggregation methods:
- For any variable type:
- *Count*: number of instances that appear in the data
- *Count defined*: number of non-empty (not NaN) instances in the data.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, maybe "number of instances with this combination of the row and column value, for which the value that is used for aggregation is defined".


![](images/Pivot-discrete.png)

Example of a pivot table with only discrete variables selected. We are using *heart-disease* data set for this example. We are using the values of *diameter narrowing* as row values, namely 0 and 1. Our columns are values of *gender*, namely female and male. We are using *thal* as values in our cells.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using the values of *diameter narrowing* as row values -> Rows correspond to values of *diameter narrowing* variable.

You can skip namely.


![](images/Pivot-continuous.png)

Example of a pivot table with numeric variables. We are using *heart-disease* data set for this example. We are using the values of *diameter narrowing* as row values, namely 0 and 1. Our columns are values of *gender*, namely female and male. We are using *rest SBP* as values in our cells.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Example
-------

We are using *Forest Fires* for this example. The data is loaded in the [Datasets](../data/datasets.md) widget and passed to **Pivot Table**. *Forest Fires* datasets reports forest fires by the month and day they happened. We can aggregate all occurrences of forest fires by selecting *Count* as aggregation method and using *month* as row and *day* as column values. Since we are using *Count*, it does not matter what our *Values* variable will be, so we will leave it as is.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does not matter what our *Values* variable will be -> maybe *Values* is unimportant (or something similar)

@ajdapretnar
Copy link
Copy Markdown
Contributor Author

Comments addressed as well as possible.

@janezd janezd merged commit d48b41f into biolab:master May 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants