OK, so now let's have a look at the other solution, the solution for the gaming's flustering project.
So this project is basically named Bastin Market Segmentation.
So we will be using K means clustering for this particular project.
You can use any other clustering algorithm.
So here in drafting the user, basically the dataset is representing a random sample of thirty thousand
US high school students who had profiles on the well-known S.A. So to protect the users anonymity,
the census will remain unnamed and the data was sampled evenly across four different high school graduation
years, representing the senior, junior, sophomore and freshman classes at the time of the data collection.
Now, this particular dataset contains 40 variables like gender, age range, basketball, football,
soccer.
All these different criteria in which the students might have interest in the final data setting basically
indicate for each person how many times each word has appeared in their Ascendis profile.
So now what we will be doing is the first thing which we do is we import all the important libraries
and we load the details.
And so here you can see the dataset contains graduation year, the gender, age number of friends and
the words in which the person has interest rates and how many times it appears.
So you can see here the friends of your sixty nine times.
If you go further, you can see here this comes four times.
So these are different kind of words which are coming in.
Now let's give somebody statistics so you can see that the graduation year is ranging from 2006 to 2009.
Age of the student is three years to one hundred and six years for a number of friends, ranges from
zero to eight, 30 and so on.
And you can see the standard deviation of different words.
So here you can see that the meaning of the word, which you can see here, is both for basketball.
It is 26.
Then you can see these are a little less popular.
Basketball seems to be highly popular.
So is football.
Then if you see, then this is a little more less of one.
And then there are kisses and these are less popular and so on.
So you can see how much these words are popular.
So this basketball, this one.
So these are point to six.
Then you can see something which is more popular, like dance is more popular, zero point four two,
then zero point seven three, which is very, very popular music zero point four six gaudens, very
popular.
So you can see these are different words which are so popular amongst these students and that's about
it.
So next, what we will be doing is you can see the gender, this differentiation.
So there are total twenty seven thousand rules of data and out of which there are two different unique
values and females, the majority here.
Let's see the difference in.
So you here you can see there are not much missing values, but there are around 5000 missing values
for each.
So what you can do is you can simply take the mean of the ages and those values.
So here at or below five thousand records of missing ages.
Also concerning is the fact that the minimum and maximum values seem to be invincible, that there's
a minimum of three years.
So that's not possible that a three year old would be using Essence's or someone our age one hundred
and six would be attending high school.
So what we simply do is we take the number of male and female candidate you can see around grindy two
thousand female and there are only 5000 Miller there.
And here's the two thousand gender values are missing.
So you're not number twenty seven hundred.
So here you can see that there are twenty two thousand female 5000 men.
And when.
Seven hundred missing values, so what we are trying going to do is we will fill all the null values
with no gender.
So we are saying that they have not disclosed their gender and we are not actually putting that as the
majority value because then it would simply be female, because females there are already a majority.
So we don't want to do that.
So they put gender has not disclosed whatever the value is not a number.
Next, what we do is we group the data based on the graduation year and the ages.
So and we take the mean.
So you can see the graduation.
It is 2006.
The age nine is in 19, then 18, 17, 16.
So based on this graduation year, this seems that these are the reasonable ages which could be imputed.
And this is a good way to actually find out what age a person should be.
So what we will do is we will group the data by the graduation year and we will fill in the data based
on the mean value from these values.
So what we have got is we have imputed the values and similarly, we have found that moral values are
present now.
So we don't have any values present.
Next, we will look at the outliers.
So here you can see the original age range contains values from three to one hundred and six, which
is unrealistic in nature because of age three or one hundred six would not entice a reasonable age range
for people attending high school would be ranging from 13 to 21.
The rest should be treated as outliers, keeping the age of student going to high school in mind so
we will detect the outlier values.
So we are generating the books plot.
So here you can see that these are the actual correct values, the ones in the middle and all other
values are actually outliers.
So what we will do is we will find no the Q1 and Q2 values and accordingly we will find out the different
ages for the outlier detection.
And here you can see that twenty five percentile is 16 and maximum is 21.
So what we are doing is we are putting the values here.
What we have applied this condition.
So what we have done, we have kept the data where the data age is greater than Q1 minus one point five
and the data age is less than Q3 one point five IQ.
So we have kept only these particular ages.
So from this data now we will check the latest data, which we now have.
So now we have reduced the number of rules to twenty nine thousand noley and now we have the minimum
age as thirteen point seven one and the maximum age as 21 years.
Now
they now what we do is you can see now there are no outliers now regarding data.
Preprocessing a common practice employed prior to any analysis using distance calculation is to normalize
visa standardize for future.
So we cannot have values with different ranges when we are using an algorithm which uses distance as
its base metric.
So all the distance based algorithms will need to have standard scanning applied.
So here we will be applying scaling.
So we will be applying standard schema here.
So the process for ZAKES standardization skews the features so that they have a mean of zero one standard
deviation of one.
So this transformation changes the interpretation of data in a way that may be more useful.
So that is what we will be doing.
So here we are taking out the column names which have values which would be having different ranges.
And we are applying standards killer on them, and now we have these skin granules present with us,
so then next thing which will be done was to convert the objectivity to numerical.
That is the categorical variables to numerical.
So we will be doing the same.
So we will take care of the gender converted into one two in three different categories.
So now we have this particular data.
After the transformation, the next thing which basically could be done is applying the key means model.
So we have applied the gaming's model and we have for model.
Next thing which we will be doing is we are running for a different number of clusters.
So we are running it from cluster range one to 20 and we are applying it and we are running the Aluko.
We are printing the L will go to see which number of clusters is actually helpful for us.
Now, the location of a mean the plot is generally considered as an indicator of appropriate number
of clusters.
Here we have this about the size of five, which is here.
So we will keep the number of clusters to we find that this key to be fight, so we will fit gaming's
with case equal to five and these are the details which we obtain.
And you can interpret the cluster sizes.
You can find out the Szilard score and evaluate the model accordingly.
You can also do this using any other than gordito of your choice and see how good values you can obtain
out of this.
That is completely up to you.
This is just one of the implementations.
Thank you.