treeheatr

Heatmap-integrated Decision Tree Visualizations

https://github.com/trangdata/treeheatr

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.0%) to scientific vocabulary

Keywords

dataviz decision-trees ggplot heatmap r visualization
Last synced: 6 months ago · JSON representation

Repository

Heatmap-integrated Decision Tree Visualizations

Basic Info
Statistics
  • Stars: 58
  • Watchers: 3
  • Forks: 13
  • Open Issues: 1
  • Releases: 1
Topics
dataviz decision-trees ggplot heatmap r visualization
Created almost 6 years ago · Last pushed over 2 years ago
Metadata Files
Readme License

README.Rmd

---
output: rmarkdown::github_document
---

[![vignette](https://img.shields.io/badge/-Vignette-green?logo=spinnaker)](https://trangdata.github.io/treeheatr/articles/explore.html)
[![documentation](https://img.shields.io/badge/-Documentation-purple?logo=read-the-docs)](https://trangdata.github.io/treeheatr/reference/)
![github-action-status](https://github.com/trangdata/treeheatr/actions/workflows/R-CMD-check.yaml/badge.svg)
`r badger::badge_cran_download("treeheatr", "grand-total", "blue")`
`r badger::badge_doi("10.1093/bioinformatics/btaa662", "yellow")`

```{r, include = FALSE}
knitr::opts_chunk$set(
  fig.path = "man/figures/"
)
```

# treeheatr 

*Your decision tree may be cool, but what if I tell you you can make it hot?*

## Changes in treeheatr 0.2.0

The first argument of `heat_tree()`, `data` is now replaced with `x`, 
which can be a dataframe (or tibble), 
a party (or constparty) object specifying the precomputed tree,
or partynode object specifying the customized tree. 
`custom_tree` argument is no longer needed.

## Install 

Please make sure your version of R >= 3.5.0 before installation.

You can install the released version of **treeheatr** from CRAN with:
```{r, eval=FALSE}
install.packages('treeheatr')
```

Or the development version from GitHub with remotes:
```{r, eval=FALSE}
# install.packages('remotes') # uncomment to install devtools
remotes::install_github('trangdata/treeheatr')
```

## Examples

### Penguin dataset

These data were collected and made available by [Dr. Kristen Gorman](https://www.uaf.edu/cfos/people/faculty/detail/kristen-gorman.php) and the [Palmer Station, Antarctica LTER](https://pal.lternet.edu/).

Classification of different types of penguin species.

```{r, fig.height=3.5, message=FALSE, warning=FALSE, dpi = 200}
library(treeheatr)

heat_tree(penguins, target_lab = 'species')
```

### Wine recognition dataset

Classification of different cultivars of wine.

```{r fig.height=3.5, dpi = 200}
heat_tree(wine, target_lab = 'Type', target_lab_disp = 'Cultivar')
```

## Citing treeheatr

If you use treeheatr in a scientific publication, please consider citing the following paper:

Le TT, Moore JH. 
[treeheatr: an R package for interpretable decision tree visualizations](https://doi.org/10.1093/bioinformatics/btaa662). 
_Bioinformatics_. 2020 Jan 1.

BibTeX entry:
```bibtex
@article{le2020treeheatr,
  title={treeheatr: an R package for interpretable decision tree visualizations},
  author={Le, Trang T and Moore, Jason H},
  journal={Bioinformatics},
  year={2020},
  doi="10.1093/bioinformatics/btaa662"
}
```

## How to Use

**treeheatr** incorporates a heatmap at the terminal node of your decision tree.
The basic building blocks to a **treeheatr** plot are (yes, you guessed it!) a decision tree and a heatmap.

* The decision tree is computed with `partykit::ctree()` and plotted with the well-documented and flexible [**ggparty**](https://cran.r-project.org/package=ggparty/) package.
The tree parameters can be passed to **ggparty** functions via the `heat_tree()` and `draw_tree()` functions of **treeheatr**.
More details on different **ggparty** *geoms* can be found [here](https://github.com/martin-borkovec/ggparty).

* The heatmap is shown with `ggplot2::geom_tile()`.
The user may choose to cluster the samples within each leaf node or the features across all samples.

Make sure to check out the [vignette](https://trangdata.github.io/treeheatr/articles/explore.html) for detailed information on the usage of **treeheatr**.

Please [open an issue](https://github.com/trangdata/treeheatr/issues/new) for questions related to **treeheatr** usage, bug reports or general inquiries.

Thank you very much for your support!

## Acknowledgements

Package hex was made with [Midjourney](https://www.midjourney.com/home/) and thus inherits a [CC BY-NC 4.0 license](https://creativecommons.org/licenses/by-nc/4.0/legalcode).

Owner

  • Name: Trang Le
  • Login: trangdata
  • Kind: user
  • Location: Cambridge, MA
  • Company: Bristol Myers Squibb

scientist

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 258
  • Total Committers: 3
  • Avg Commits per committer: 86.0
  • Development Distribution Score (DDS): 0.023
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Trang Le g****r@g****m 252
Trang Le t****e@b****m 5
Ben Marwick b****k@h****m 1
Committer Domains (Top 20 + Academic)
bms.com: 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 5
  • Total pull requests: 3
  • Average time to close issues: about 1 month
  • Average time to close pull requests: about 9 hours
  • Total issue authors: 2
  • Total pull request authors: 2
  • Average comments per issue: 0.2
  • Average comments per pull request: 0.67
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • trangdata (4)
  • kevinwang09 (1)
Pull Request Authors
  • trangdata (2)
  • benmarwick (1)
Top Labels
Issue Labels
enhancement (1)
Pull Request Labels

Dependencies

DESCRIPTION cran
  • R >= 3.5.0 depends
  • cluster * imports
  • dplyr * imports
  • ggnewscale * imports
  • ggparty * imports
  • ggplot2 * imports
  • grid * imports
  • gtable * imports
  • partykit * imports
  • seriation * imports
  • stats * imports
  • tidyr * imports
  • yardstick * imports
  • forcats * suggests
  • knitr * suggests
  • rmarkdown * suggests
  • rpart * suggests
  • testthat >= 3.0.0 suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v2 composite
  • peaceiris/actions-gh-pages v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
.github/workflows/pkgdown.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite