MyNixOS website logo
Description

Heatmap-Integrated Decision Tree Visualizations.

Creates interpretable decision tree visualizations with the data represented as a heatmap at the tree's leaf nodes. 'treeheatr' utilizes the customizable 'ggparty' package for drawing decision trees.

treeheatr: an introduction

vignette documentation github-action-status

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:

install.packages('treeheatr')

Or the development version from GitHub with remotes:

# install.packages('remotes') # uncomment to install devtools
remotes::install_github('trang1618/treeheatr')

Examples

Penguin dataset

Classification of different types of penguin species.

library(treeheatr)

heat_tree(penguins, target_lab = 'species')

Wine recognition dataset

Classification of different cultivars of wine.

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. Bioinformatics. 2020 Jan 1.

BibTeX entry:

@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 package. The tree parameters can be passed to ggparty functions via the heat_tree() and draw_tree() functions of treeheatr. More details on different ggpartygeoms can be found here.

  • 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 for detailed information on the usage of treeheatr.

Please open an issue for questions related to treeheatr usage, bug reports or general inquiries.

Thank you very much for your support!

Metadata

Version

0.2.1

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows