Interactive decision trees with Microsoft R

December 20, 2016

(This article was first published on Revolutions, and kindly contributed to R-bloggers)

Even though ensembles of trees (random forests and the like) generally have better predictive power and robustness, fitting a single decision tree to data can often be very useful for:

  • understanding the important variables in a data set
  • exploring unusual subsegments of the data (and the explanatory variables that define them)
  • presenting a simple, decision-based model to management to explain behaviors in data
  • illustrating a model graphically

But to get the best out of a decision tree, you need to be able to look at it, interact with it, and able to present it attractively. This blog post by Longhow Lam demonstrates the interactive tree viewer in Microsoft R, which lets you explore the individual nodes and breakpoints in the fitted tree, which can be embedded on a web page or printed in a report. Click on the screenshot below (from an analysis of the Titanic survivor data set) to try it out.


You can create interactive trees like this in Microsoft R Client (available free) or Microsoft R Server using the createTreeView function. 

For more on the uses and benefits of single trees, check out Longhow Lam's blog post linked below.

Longhow Lam's Blog: Don’t give up on single trees yet…. An interactive tree with Microsoft R

To leave a comment for the author, please follow the link and comment on their blog: Revolutions. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)