Alright. So, we've actually done pretty well. So through all of
this, we finally figured out what decision trees actually are. We know
what they represent. We know how expressive they are. We have
an algorithm that let's us build the decision trees in an effective
way. We've done just about everything there is to do with
decision trees, but there is still a couple of open questions that
I want to think about. So, here's a couple of them and
I want you to, to think about and then we'll discuss them.
So, so far all of our examples that we've used. All
the the things we've been thinking about for good pedagogical reasons. We
had not only discreet outputs but we also had discreet inputs. So
one question we might ask ourselves, is what happens if we have,
continuous attributes? So Michael, let me ask
you this. Let's say we had some continuous
attributes. We weren't just asking whether someone's an
animal or whether they're human or whether it's
raining outside or we really cared about age
or weight or distance or anything else that
might have a continuous attribute. How are we
going to make that work in a decision tree?
>> Well, I guess the literal way to do it would
be for something like age to have a branching factor that's equal
to the number of possible ages.
>> Okay, so that's one, one possibility. So we stick in age and then
we have one. 1.0, we have one for 1.1, we
have one for 1.11, we have one for 1.111
>> Ahh, I see. Alright. Well, at the very least, okay. Heheheh. What
if, what if we only included ages that were in the training set?
Presumably there's at least a finite number of those. Oh,
we could do that. We could just do that, except
what are we going to do then when we come up
with something in the future that wasn't in the training session.
>> Oh, right. Can we look at the testing set?
>> No were not allowed to look at the testing set. That is cheating,
and not the kind of good cheating that we do when we pic good representation.
>> Okay, fair enough. Well we could, we could Ranges. What about ranges?
Isn't that the way we cover more than just individual values?
>> Give me an example.
>> Say ages you know, in the 20s.
>> Okay, so, huh. How would we represent that
with a decision tree? Let's say in the 20s. Age.
>> How we do that.
>> You could do like age, element sign, bracket.
>> 20.
>> 20 comma 21, or, or 29 or 30 right
per end.
>> Yeah it's too much. Why don't I just say age
Is between less is, let's see, greater than or equal to, 20 and, less than 30.
And just draw a big oval for that. Alright? So that's a range, so
that's all numbers between, 20 and 30 inclusive of 20 but not 30 Right.
>> Yeah.
>> And what's good about that is that's a question. You are either in your
20s or you are not. So, the output of that is actually true or false.
>> So, I guess the good news there is that now
we know how to evaluate attributes like that because we have
a formula from ID3 that tells you what to do.
But seems like there's an awful lot of different ones to check.
>> Right, and in fact if it's
truly a continuous variable, there are in principal an infinite number of
them checked. But we can do now the sort of cheating you wanted
to do before. We can just look at the training set, and
we could try to pick questions that cover the sorts of data in
the training set. So, for example, if all of the values are
in the 20s, then there is no point of even asking the question.
You will start just split instead upon values that were, say less than
25 or greater than 25, and you could imagine all kinds of ways
where you might do that. You might look at all of the values that show up in
the training set, and say well, I am going to do a binary search. So, I am
just going to create an attribute for Less
than half of whatever is in the training set
or greater than half of whatever the range
is in the training set. Does that make sense?
>> Yeah, that's clever.
>> Right. Thank you. I just made that up on the
spot. Okay, so you do those sorts of things and that's how
you would deal with continuous attributes. That brings me to a next
question, I'm going to actually do this as a quiz because I
want an answer from our audience.