Hello, everyone, and welcome to new section on Spam Message Classification Project.
So in this section, what we are going to do, we are going to import one spam message deleted file
and we'll be applying on a different machine learning algorithm.
One is a random forest.
Hannah Hestia.
So let us have a look at post about the data and then we will see about what is the business problem
running behind it.
And for that, we help upload one local file so you can click on a file.
Click on upload and navigate to where you kept this file.
So inside my folder I have kept here spam dot DSE file.
So they might get uploaded file veigar delegate.
When that untimed will be recycled.
That's OK.
All right.
So what we can do?
Let's try to import this data first for that.
First of all.
We are going to import our all basic necessity required library numpty, find us and make part.
And let me just.
Heidi, let's just run it.
All right.
Now we are going to use this very beauty dot to see this function.
To read this Hoffs.
Spambot, BSEE, I know everything here, ACAP separately.
So we are going to use this separator.
As a Slessor, he.
And let me assigning to some data from object B F.
Perhaps there is some issue.
All right.
It's not set, it's a separate.
That means SICP.
So that's a small typo.
All right.
Now, let us have a look at the data for us and then we will figure out what we need to do.
So I'm just displaying phosphide codes with the help of this HERIT function, and you will be able to
see V how one column gets a very important.
And that's where whole data recites.
That is nothing but our message column.
And each individual message has been associated with ham.
It will be a spam and for each individual message they have given Leiker.
What is the length of that particular message?
Although this bill looks like an already computed field, that if you just apply a land function on
top of this message column, you'll be able to get this one hundred again eleven similar like in each
individual message.
How many punctuation mark exists?
So as a business problem, our object is to build a model which will do this binary classification between
two class.
Either it will be a ham or a spam.
So based on message, need to classify weather messages, spam quantities, not spam.
All right.
So let's do some more basic analysis on top of this data.
Something like whether we have any missing records or not so far that we can just simply use B.F. DNA.
And if you execute it, it will be done like a true and files.
So wherever there is something missing, it will return like a probe.
Otherwise it will return false.
So what we can do on top of that, we can apply some matter.
And what each individual column.
What I would say feature it will give us that.
How many do exist.
So in our case, that is not true.
That means our data is complete in the sense that there is no missing value existing of it.
At this.
We can have a look at that data set like from ducktail on, so.
So on the back side of the data so we can verify.
What that data is, and you can see the data is starting from indexing zero to five five seven one Beckman's,
there are total five five seven two records exist and each of the record has been assigned a Leeville
Ham or spam.
Now we have just a two column that is a numeric, although we can do all those statistical analysis
on top of it.
So let's have latently, if not describe.
And it will do those statistical analysis on the top of just the numerical column.
So you can see in case of land and punctuation.
So in both the cases, we have a total five five seven two record of valuably.
And in case I mean, the average Lindop of our message is fifty point forty eight characters.
And a punctuation mark average in each of the masses is like a four point seventeen.
And in case of standard deviation, it deviates too much from this.
Like 59.
Whereas in case of punctuation Mark, the deviation is four point sixty two.
Although this information doesn't really bitingly helpful while classifying stuff, because if you just
do all those thing grouped by and if you apply those matter.
It will be very much has.
So what we can do on the top off label, if we can apply and we can try to grab how many of the records
sort of hammer and how many records are spent.
So let me do this on our label column.
So it will be a label and let's play Relu finish school, Collins.
All right.
So we have total four thousand eight hundred and twenty five records that are ham and just the selling
40 because out of spam, that means it's a very much imbalanced dataset.
I would say we can even divide by the length of the F.
So in terms of percentage, we'll get those numbers.
You can even multiply by hundred.
An.
I have to multiply here.
It's not here.
So what we can do instead of multiply by.
Here, I could only play here.
But that's OK.
So here the indication is that.
Eighty four percent.
86 percent digital data are lying in a basket of ham.
That is just the fourteen thirteen point forty percent digital data.
Lying in a hospital spam.
So it's kind of very much imbalanced data set.
So we are not going to do all those training on a complete dataset.
Because then it will be a kind of a little bit biased.
So in the next video, we will see how you can take equivalently same amount of data, say, for the
further analysis from both the Glassey side that it will be a spam or it will be a ham.
All right.
So see you in the next video.