Forum Discussion
Decision Trees in Power BI
- 8 years ago
I came across this same issue today.
In case you're still looking for a solution, here's what I have figured out so far:
Every time you associate a target variable and select a few input variables, Power BI internally creates a data-table from your original set that contains only the fields you have selected.
It then goes and deletes all duplicate rows.
Assume your original input data is a 5x5 table like:
Distinct Var A Input B Input C Input D Target 1 a 1 2 1 TRUE 2 b 1 2 2 TRUE 3 c 2 1 1 FALSE 4 d 2 3 1 TRUE 5 e 0 1 1 FALSE
At this point, you have 60% True, 40% False.Let's say you set your target and pick only Input D as the input variable.
Your internal data-table being used for the decision tree looks like:
Input D Target 1 TRUE 2 TRUE 1 FALSE Now, you have 66.67% True, 33.33% False.
Let's say you now use Input C as an additional input variable.
Your new internal data-table for the decision tree looks like:Input C Input D Target 2 1 TRUE 2 2 TRUE 1 1 FALSE 3 1 TRUE Following along, you're now at 75% True, 25% False
This explains why the values in your root node keep changing every time you modify the input variables.
I haven't yet been able to figure out a way to make this funny (maybe as designed, but I don't like it) behavior stop.
As a workaround, I'm considering including a variable that is unique for each record. Ideally, the tree should never be splitting on that varaible and it'll ensure that all records of your data are considered, since there won't be any duplicates.Let me know if this makes sense/works. Cheers!
KK
freswood,
Could you please share sample data of your table?
Regards,
Lydia
Hello,
Relating to last question, we had the same issue with our data, the percentage is wrong compared to what we can found; in our example, the part of defect is around 24 % in the brut file, with Power BI after getting those data, it’s rather 47%. Can you explain where might be the problem is located ?
I tried to join the file, but not possible with this platform.
Can you indicate me your professional e-mail for sending the file ?
Sincerely,
O.N.