The very first thing we'll start with will be to impart our C curve.
So we have our C curve and this is part of can learn metrics.
So we'll run this again.
And then just right here, we'll make use of our method.
We're going to output the number of it's going to output a number of false positives, true positives,
and then thresholds which we'll use in coming up with our C plot.
So we have that, we have our rosy curve, rosy curve, and then this takes in the labels and then the
and then the predicted.
So we have this predicted value.
Now if you print this length out, the length of FP, length of TPI and len of thresholds, So we have
exactly the same number thresholds here.
We should have exactly the same number.
Here we have three 3330.
Okay, So now we have this.
Now note that the reason why we need this is because when coming up with our rosy plot, like, say
we have this rosy plot we want to have for each and every point, the corresponding TPI FP and then
the threshold which will lead to that girl tpi FP pair.
So that said, we are going to make use of this data now and then plot out the rosy curve.
So let's get straight into that.
We have our plot and then we do plotting.
We pass in the false positives through positives just like x Y.
So here we have X and then here is why, let's get back.
That's fine.
And then from here we have the levels.
So we have X level, which is our false positive and then the Y level are true positive rate.
So we've seen this already.
Now we have this.
We could include the green, so we have this greed and then we show.
So that's it, we run that and here is what we get.
So this is our C plot right here based on this FP and CP we got from here.
Now, how do we include this thresholds?
In order to include these thresholds, we are going to make use of map plot leaps, test method.
So we have plot that text and then here we're going to have the TPI or the FP, TPI and then what the
actual text will be put it in here will be the thresholds.
So we'll be passing the thresholds.
But now not that we actually have to do this for each and every point, which is impossible since there
will be too many texts put out here and it's going to be choked up.
So what we could do is we could keep some values.
So we say for I in range, we're going to start from zero right up to the length.
That's actually going to be 330 length of thresholds.
And then we are going to skip skipping some values.
So skip and then we'll define the skip.
So let's start with this keep of 20.
So initially we're going to skip 20 values and then once we skip this value, let's pass this in here.
Once keep this value, we pick in a given I picking that given I same year and then we do the same with
the thresholds.
So we get the corresponding false positive rate corresponding to positive rate and then the corresponding
threshold.
Now that's done, we could run this.
So here is what we get.
We see this plot now, we could see the Rosie plot with the different thresholds.
Let's I think we could let it like, this is fine, let's increase the size and then we try to focus
just on this portion, which actually matters the most, because we wouldn't want to get into this regions,
because in these regions are false, positive rate is going to be too high and this regions below this
would have a very small, true positive rate.
So generally we try to focus on this zone right here.
Now, depending on the problem you are trying to solve, if your false positive rate is what matters
the most, that is, if you cannot afford to have a high false positive rate, then you tend to pick
values.
Let's say let's let's break it out like this.
So here is like the meet points.
We have some sort of meet here.
Let's let's draw this line.
Okay.
So we have some sort of midpoint here.
So this is like 0.50.46, 0.62 and all of that.
So we're breaking it up like this.
And then if you want to ensure that you try to minimize as much as possible.
Or a false positive rate without reducing your true positive rates too much, then you tend to take
values around this.
But if you want to make sure a true positive rate remains quite high, even at the detriment of the
false positive rate, then you tend to pick out values in the zone.
So you have these two zones to pick your threshold from.
This is the main zone.
And then you have this zone right here.
This other zone and this other zone.
So we have zone one and zone two from which you have to pick from.
One other quick note is that if you have a problem like the one we're trying to solve, where parasite
is zero and then uninfected is one.
So that is how the data set was created.
And this based on this, we build our model.
Then this means that this will be considered as negative samples.
While this will be considered as positive samples, whereas in the real world we will tend to look at
uninfected as negative and parasitic as positive.
So you have to be very careful with these terms and know exactly how your dieter and models have been
built.
And that's why in our case, where we're trying to avoid situations where our model predicts a fake
uninfected output that is a patient will actually has a parasite, but the model predicts that it's
uninfected, there's actually a fake uninfected.
This is a fake or false positive in our case.
So we'll tend to minimize this number of false positives.
Now, if you model was built such that parasitic is one and then uninfected is zeros, then it's clear
that you will try to instead minimize the number of false negatives since uninfected is considered as
negative.
That said, coming back to our problem, since our dataset was constructed in this way, we're trying
to minimize the number of false positives at all cost.
But while doing this, we have to ensure that the true positive rate remains at the reasonable position.
And so we could pick out a threshold of like 0.6265 given right here.
Getting back to this, let's take 0.6265.
We run that we have a number of false positives to be 87, which is going to be smaller than when we're
having a threshold of, say, 0.5.
Run that again.
You see, eight is seven is going to be smaller than this 99, the value of 99 we get in now.
And so that's it for this section on metrics.
Thank you for following up to this point and see you next time.