Open Side Menu
Skip to contentBrand Logo
Forums
Inspiration
Ideas
Communities
Blogs
Learning
Support
RegisterSign In
  1. Microsoft Fabric Community
  2. Power BI forums
  3. Galleries
  4. R Script Showcase
Sharon's avatar
Sharon
Microsoft Employee
10 years ago

Decision Trees

  Description With decision trees, you can visualize the probability of something you want to estimate, based on decision criteria from the historic data. The decision tree classifier aut...
Decision Trees Showcase.pbix1 MB
ScriptInstallPackagesWithWorkaroundsDtree.R1 KB
Advanced Analytics Visualizations
realexander's avatar
realexander
Frequent Visitor
8 years ago

Hello Sharon, 

 

Thank you for sharing this example. I have a question, I just tried the following short code for plotting a decision tree in Power BI: 

-----------------------------

library(rpart.plot)
library(rpart)

set.seed(1)
fit <- rpart(Kyphosis~Age+Number+Start,method="class",data=kyphosis)

rpart.plot(fit)

-----------------------------

 

That worked very well and the plot appeared to be OK in PBI Desktop, but once I published the file on Power BI service the plot changed a lot (attached file). 

 

Then I tried with your template and the plot is perfect on desktop and on PBI service. I noted some differences in the code like the function replaceFancyRpartPlot(). But I don't know exactly why the visual changed so much between desktop and the version published on the web. 

 

Can you give me a hand with this? 

 

Thanks in advance. 

J.

 

 

 

 

boefraty's avatar
boefraty
Microsoft Employee
8 years ago

Hi realexander, 

The differences in performance for  PBI desktop and service are due to different R engine (and packages) vesrions. 

Unfortunatly, we still have R3.2.2 in service, it is about to be upgraded next month. 

  • © 2026 Microsoft
  • Manage cookies
  • Privacy & cookies
  • Terms of use
  • Trademarks
Your Privacy Choices Consumer Health Privacy