hello and welcome back to data science Wednesday my name is Tessa Jones I'm a
data scientist with decisive data and today we're gonna be talking about
machine learning it's a really big buzzword right now it's all over the
place today we're going to talk about how it applies to data science and
really break it down into two general categories unsupervised machine learning
and supervised machine learning the basic difference between these two
actually has to do with the data that we're inputting into the model and our
objectives going out unsupervised machine learning is when we have
unlabeled data we have a lot of variables but we don't necessarily know
where they fall in terms of what our objective is supervised machine learning
on the other hand is when we have a series of variables and they are labeled
so for example maybe we have a data set about flowers we have lots of variables
that describe the flowers the features of the flowers and we have it labeled we
know that it's species a B or C what we really want to know is what we want to
be able to do is take something like this and then take another data set that
isn't labeled that has the same variables push it through a decision
tree to decide which species it is that's the real goal here so this is the
end result of machine learning supervised decision tree during this
basic process when it was doing the machine learning it iterated through all
the different variables and which flowers it was specified as and it
really optimized where these nodes are located in the tree and what these
values are that distinguish between the different species and the different
nodes iterates through this many many times until we've really optimized or we
feel really confident about what species we're designating based on the features
that we're inputting into the tree so another example of machine learning
supervised machine learning is regression in this example we're going
to talk about sleep and because we all know that the less sleep
you get like if you don't get very much sleep you're generally not very happy
but also if you get too much sleep you're really not that happy either here
we have on the x-axis number of hours of sleep and on the y-axis we have a
happiness scale so here you don't have you don't have very much sleep you're
not very happy you start to get happy the more sleep you get and then you
reach a point where the more sleep you get the less happy you are so a good
work use case for this would actually be like let's say you're a physician and
you want to be able to predict how happy a patient will be when they tell you how
much sleep they get on average what we want to do is create a function from the
data that we have each point here represents a person in our supervised
data set we took a subset of people and we said ok how much sleep do you get and
how happy are you we have a whole set of data here that tells us exactly that
that's what each point represents and we want a line here to designate to
basically represent that data so that when we're a physician and a patient
comes in and says I'm getting 12 hours of sleep well that one's kind of obvious
maybe maybe your happiness scale would be really low but let's say it's six
hours they want to be able to push it into this function and say well your
happiness scale is probably going to be around a seven good news the way that
this works is it iterates the way the machine learns this is it draws lines
iteratively through these data points in hopes to best represent the data it does
this as many times as we tell it to and then eventually it gets to this line
that is the optimum representation for this data so now let's go into
unsupervised machine learning so to give a little bit of a recap unsupervised
means that it's unlabeled we don't really know what we're we're dealing
with one good example of unsupervised machine learning is clustering this is
used a lot of times in marketing campaigns when we want to do customer
segmentation we want to understand customers how they are so that we can
have targeted marketing campaigns let's take an example with cereal
so this is the final result of clustering unsupervised machine learning
algorithm and we have a serial we want to know something about our customers
that buy cereal so we're going to look at two different variables we're going
to look at fiber and we're going to look at sugar so on the x-axis we have fiber
and on the y-axis we have sugar up here this is probably where I belong where I
like a lot of fiber but I also like a lot of sugar
we've called these guys the high fibers in the middle here we have your average
joe's they kind of like a medium amount of sugar meeting amount of fiber and
then we have your lean Larry's where they want to keep their sugar content as
low as possible if this was a supervised Dexamyl we would have all of this
information and this data would already be labeled but we don't have that we had
to make this up not knowing how how these different groups would fall the
way that this kind of worked and iterated through so you see this line
here is really what Doug designates between these two groups and it went
through a clustering algorithm many many times and it basically redrew this line
so maybe the first time it would belong here and these these two guys down here
might belong to the high fibers and maybe the next time it was drawn like
this where these guys are considered the average joe's and these guys were
considered the high of fibers and eventually it found an optimum place to
place that line so that we can best represent these two different groups and
then target them in a marketing campaign another really great use of machine
learning is what's called dimension reduction this is largely used as a tool
to help data scientists reduce the number of dimensions that we're using in
our models so that they can be more timely and effective a lot of times we
can have lots and lots of variables and we'd like to reduce them down one
example one way to do this is to when things are really obvious so sometimes
you just know that data isn't really going to matter so if we have the same
problem here or thing here where we're trying to identify what's the best
corollaries to segment customers in terms of buying cereal we might know
that they really don't care about what caking agent the cereal has in it so
maybe we'll just throw that out because we know that it doesn't really
matter however we might know that dye really does matter so maybe we can take
three different colors of dye maybe we have blue yellow and red and we can make
these three variables down into two variables we hold the same amount of
information but we're holding it in two variables rather than three and
basically the way that the machine learns the optimum way to represent
these three variables is these are the two new variables that we're going to
create and it basically positions these in different locations in this
three-dimensional space until they have the optimum representation of these
three different kinds of dye that's the general overview of machine learning
we're talking about unsupervised and supervised machine learning where we
have labeled data to work with we have unlabeled data to work with we can do
clustering dimension reduction regression and decision trees there's
lots of other things that we can do with data with machine learning and data
science and thanks for joining me today my name is Tessa Jones with decisive
data