[MUSIC]
Now that we had the chance to review the basics of probability,
let's figure out how it can be useful in the classification problem.
So, if we take our two sentences, one where was definite plus one,
definite positive, the sushi and everything were awesome!
And the other one I was not sure, the sushi was good, the service was okay.
For the first one, you can say that the probability that it's a positive review
for this sentence is very high.
So, the probability that y equals plus one, given the sentence is 0.99.
On the other one though, the probability of y equals plus 1 given the sentence,
given x equals the sushi was good, the service was okay, that's only 0.55.
And in general, many classifiers output this degree of beliefs,
or this probability.
So the probability of the wide output label y given input x, and
it's going to be extremely useful in practice.
So let's go through a little bit of an example of what that means.
So let's say we're given an input data set with N data points.
They have inputs, number of awesomes, number of awfuls and the labels y.
And I use it to train the classifier that outputs these probabilities,
the predictions we're going to call that P hat, or
estimate of the predictions which are going to spend on the parameters w hat, or
the coefficients w hat for our model.
And so P hat is going to be useful for predicting y hat,
the predictive class, which in our case is the sentiment for senders.
So, let's see how that works.
What we're going to do is learn this P hat estimated from data,
and use it to predict the most likely class.
So in particular, if I'm giving you some input sentence and
I compute the probability the y is plus one, it's a positive review given
the sentence and that's greater then 0.5, I say the y hat is plus one,
its a positive sentence and if you say that its less than 0.5,
then we say it's a negative sentence, so y hat is minus one.
But we're not just going to get that,
P hat is going to give us more kind of interpretive output.
So it's not going to say just plus one and minus one, but
it's going to tell us how sure we are that this is a positive review.
[MUSIC]