I'm a complete beginner when it comes to R and decision trees, but I was asked to take a look at this to see if this was a viable solution for my data. So please excuse me if I say completely wrong.

This kind of goes along with this previous question. From the answers of the previous linked question, Rob mentions that all attributes (variables) must be interactive with eachother, which is true within my data. Simon also mentions that very minute changes of the attributes change give off completely different tree results, which is also true in my data.

And so here's the problem, some of my attributes that I want to use in the decision tree are numeric, so no factors. I was hoping the algorithm would decide the factors for me.

So you're probably thinking, why not just let the algorithm do its thing and let it create the thresholds for your data? Well, it seems like it couldn't decide on a good threshold for any of the numeric attributes, and there isn't much of a decision tree (meaning it was giving me an obvious fact that I already knew and it didn't use any of the other attributes).

So I then decided to cut factors based on what I thought was correct (manually setting the factors) and the decision tree was a little bit ore expanded, which was heading in the right direction. However, as Simon mentioned before, changing the attributes will most likely result in a different tree. And when I changed the threshold for 1 attribute slightly, it gave me a completely different tree with a different set of rules.

So I guess my question would be, when creating a decision tree, how would you choose the best factors to cut your attributes by? That is, how would I know what thresholds I should set my attributes to. I would think most of you would say, "it really depends on your data", but I'm trying to see if somebody has a systematic approach to dealing with this. Please let me know, thanks.

To answer @ttnphs question, because this site doesn't allow me to give long comments and I don't want to wait 5 minutes to post up a new 2 part response.

It does decide what attributes have the highest gain, however, the decision tree isn't as large as I wanted and it's giving me an obvious result. For example, let's say I have a numeric attributes such as present money value, education level, location, etc. for each row and a conclusion column that states if the person is wealthy or not. And let's also say that people who have more than 10000 right now are considered wealthy (for this example). Then the results of my current decision tree shows that people who have more than 10000 are rich and everyone else is not rich, despite the other attributes. So it's basically reiterating the fact that was already known. This is fine, but you also have to consider that there are other attributes that come into play, such as education level, location, etc. (for this example).

@ttnphs for the second response

Thanks for the link, it might help with my specific case and I'll take a look at it more closely tomorrow. But you must know that even changing the attributes in the slightest way give a different set of results. And what I want is to see how to set thresholds for the attributes. And you're also correct about the dull results, I'm not expecting it to use all of the inputted attributes, but when it's giving known facts, then there's no point in using it for that specific case. You must know that even changing the attributes in the slightest way give a different set of results and if I change the attributes slightly, then it's going to give me a different set of results, so how would I know which one is better? Again, it all has to do with how I pre-process my data, but I just was hoping if there was a better approach to this rather than taking a guess at which decision tree is best.

  • 1
    $\begingroup$ I was hoping the algorithm would decide the factors for me It should. Why are you dissafisfied and want to do it manually? Please see probably a related question. $\endgroup$
    – ttnphns
    Apr 15, 2013 at 14:15
  • $\begingroup$ It's normal to get dull and trivial results instead of something "Wow, interesting!". But of course it's your right to pre-process data in a way you like. For example, you could log-transform variables such as money (income?) $\endgroup$
    – ttnphns
    Apr 15, 2013 at 14:30
  • $\begingroup$ Look at the bottom of the question. And thanks for helping, I really appreciate it. $\endgroup$
    – robjob27
    Apr 15, 2013 at 15:09


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.