📩 for Collaboration
_______
That's a wrap. Every day I simplify complex concepts around Python, Machine Learning & Language Models.
Follow me to ensure you don't miss that.
Like and share the first post to support my work and help this reach more people
_______
That's a wrap. Every day I simplify complex concepts around Python, Machine Learning & Language Models.
Follow me to ensure you don't miss that.
Like and share the first post to support my work and help this reach more people
Data Pre-processing step
Fitting the K-NN algorithm to the Training set
Predicting the test result
Test accuracy of the result(Creation of Confusion matrix)
Visualizing the test set result.
12/12 🧵🧵
Data Pre-processing step
Fitting the K-NN algorithm to the Training set
Predicting the test result
Test accuracy of the result(Creation of Confusion matrix)
Visualizing the test set result.
12/12 🧵🧵
Always needs to determine the value of K which may be complex some time
The computation cost is high because of calculating the distance between the data points for all the training samples
11/12 🧵👇
Always needs to determine the value of K which may be complex some time
The computation cost is high because of calculating the distance between the data points for all the training samples
11/12 🧵👇
It is simple to implement
It is robust to the noisy training data
It can be more effective if the
training data is large
10/12 🧵👇
It is simple to implement
It is robust to the noisy training data
It can be more effective if the
training data is large
10/12 🧵👇
try some values to find the best out of them
most preferred value for K is 5
low value as K=1 or K=2, can be noisy & lead to the effects of outliers in the model
Large values are good but it may find some difficulties
9/12🧵👇
try some values to find the best out of them
most preferred value for K is 5
low value as K=1 or K=2, can be noisy & lead to the effects of outliers in the model
Large values are good but it may find some difficulties
9/12🧵👇
Next, we will calculate the Euclidean distance between the data points
The Euclidean distance is the distance between two points
8/12 🧵👇
Next, we will calculate the Euclidean distance between the data points
The Euclidean distance is the distance between two points
8/12 🧵👇
Step-5: Assign the new data points to that category for which the number of the neighbor is maximum
Step-6: Our model is ready.
7/12 🧵👇
Step-5: Assign the new data points to that category for which the number of the neighbor is maximum
Step-6: Our model is ready.
7/12 🧵👇
The K-NN working can be explained on the basis of the below algorithm:
1: Select the number K of the neighbors
2: Calculate the Euclidean distance of K number of neighbors
3: Take the K nearest neighbors as per the calculated Euclidean distance
6/12 🧵👇
The K-NN working can be explained on the basis of the below algorithm:
1: Select the number K of the neighbors
2: Calculate the Euclidean distance of K number of neighbors
3: Take the K nearest neighbors as per the calculated Euclidean distance
6/12 🧵👇
To solve this type of problem, we need a K-NN algorithm.
With the help of K-NN, we can easily identify the category or class of a particular dataset
5/12 🧵👇
To solve this type of problem, we need a K-NN algorithm.
With the help of K-NN, we can easily identify the category or class of a particular dataset
5/12 🧵👇
also called a lazy learner algorithm
does not learn from the training set immediately instead it stores the dataset
at the time of classification, it performs an action
4/12 🧵👇
also called a lazy learner algorithm
does not learn from the training set immediately instead it stores the dataset
at the time of classification, it performs an action
4/12 🧵👇
K-NN algorithm can be used for Regression as well as for Classification but mostly it is used for the Classification problems
3/12 🧵👇
K-NN algorithm can be used for Regression as well as for Classification but mostly it is used for the Classification problems
3/12 🧵👇
put the new case into the category that is most similar to the available categories
K-NN algorithm stores all the available data and classifies a new data point based on the similarity
2/12 🧵👇
put the new case into the category that is most similar to the available categories
K-NN algorithm stores all the available data and classifies a new data point based on the similarity
2/12 🧵👇