Outstanding! I once heard that a persons intellect correlates with his/her ability to explain it in a simple enough matter that someone with no experience or prior knowledge will understand it. So Sir, your must be a genius! I'm doing a project in machine learning, and this is the single greatest explanation of the entire KNN concept. Thank you very much.
Hi. Great Video. But I got lost in 10:04, you start explaining that in one dimension the search space in 0.004, considering k=4 and an expected split of 1/1000 among data. Then when you moved to 2 dimensions I dont get why you keep the value of 0.004 for the area of the rectangle. I mean if I placed the new observation in the middle of the square then the radius of the corresponding circle would be 0.00285, matching it with the diagonal of the outter square required to 2 point on each side of the diagonal. Could you explain me this.
Thank you so much for this video. In case i want to predict the univariate time series with 2 variables t:time and x:value at time t. Would you mind to give me some advice about how to do it?
great video, very useful. I am not entirely sure your "dist = np..." line is doing what you hope it is doing. It is NOT outputting a single distance value, as far as I can see. np.sqrt(np.square(X_train[i]-new_x_sample).sum(axis=1)) something more along these lines you might like to try
@@NormalizedNerd Yes apologies. I'm not sure what happened in my code to lead me to the conclusion above. Sure enough the following outputs single distance values: arr1 = np.array([[0.73654, 0.321242], [0.33654, 0.121242], [0.93654, 0.121242]]) arr2 = np.array([0.23253, 0.545423]) for i in range(len(arr1)): dist = np.sqrt(sum(np.square(arr1[i]-arr2))) print(dist) Thanks again for a great video
Sorry to keep going on about this... The following screenshot shows why it is I am feeling a bit confused here. I can't see my mistake but I must have made an error somewhere i.imgur.com/0XWbRSj.jpg
@@NormalizedNerd I think you're quite right. Even though my "sample data" contains only ONE row of data, when I call the function it seems I am still required to specifically refer to the first element: sample_data[0] in order for the loop to produce a single distance measure. Sometimes the behaviour of Python is surprising to me, as in this case - thanks for your feedback and for the code which has been an excellent education.
@@NormalizedNerd I'm not really familiar in this field of study but in my current project, we have to use KNN for a database that has the dimension of 520 columns, I have heard of preprocessing approaches to reduce the dimensions of the database like by removing the less "important" features but I'm not really sure how KNN is used in this scenario, do you have any suggestion?
The trick is to reduce the number of features using PCA or (and) tSNE. Then you can apply KNN. As a rule of thumb, you should reduce the dimension below 50.
your channel is a blessing to us students! thank you and keep em coming!
Outstanding! I once heard that a persons intellect correlates with his/her ability to explain it in a simple enough matter that someone with no experience or prior knowledge will understand it. So Sir, your must be a genius! I'm doing a project in machine learning, and this is the single greatest explanation of the entire KNN concept. Thank you very much.
Loved your words...Best of luck for your project.
Hi. Great Video. But I got lost in 10:04, you start explaining that in one dimension the search space in 0.004, considering k=4 and an expected split of 1/1000 among data. Then when you moved to 2 dimensions I dont get why you keep the value of 0.004 for the area of the rectangle. I mean if I placed the new observation in the middle of the square then the radius of the corresponding circle would be 0.00285, matching it with the diagonal of the outter square required to 2 point on each side of the diagonal. Could you explain me this.
Nice explanation, thanks to share
My pleasure
Super bro nice explanation and one thing i want to understand HOW KNN GETS OVERFIT?
Amazing content thank you sir !
sound is just awesome.Super Bommmmm
Thank you!!
Can you please tell what happens when there are 2 green and 2 red classes for a new data in knn classification algorithm?
You should never select a k value which will be even. Select k value which will be odd like 3,5,7.
Thank you so much for this video. In case i want to predict the univariate time series with 2 variables t:time and x:value at time t. Would you mind to give me some advice about how to do it?
great video, very useful.
I am not entirely sure your "dist = np..." line is doing what you hope it is doing. It is NOT outputting a single distance value, as far as I can see.
np.sqrt(np.square(X_train[i]-new_x_sample).sum(axis=1))
something more along these lines you might like to try
Please run the code. It should output a single value.
@@NormalizedNerd Yes apologies. I'm not sure what happened in my code to lead me to the conclusion above.
Sure enough the following outputs single distance values:
arr1 = np.array([[0.73654, 0.321242], [0.33654, 0.121242], [0.93654, 0.121242]])
arr2 = np.array([0.23253, 0.545423])
for i in range(len(arr1)):
dist = np.sqrt(sum(np.square(arr1[i]-arr2)))
print(dist)
Thanks again for a great video
Sorry to keep going on about this... The following screenshot shows why it is I am feeling a bit confused here. I can't see my mistake but I must have made an error somewhere
i.imgur.com/0XWbRSj.jpg
@@spearchew I guess it's a problem related to dimensions. Print the dimensions of everything that you are accessing inside the loop.
@@NormalizedNerd I think you're quite right. Even though my "sample data" contains only ONE row of data, when I call the function it seems I am still required to specifically refer to the first element: sample_data[0] in order for the loop to produce a single distance measure.
Sometimes the behaviour of Python is surprising to me, as in this case - thanks for your feedback and for the code which has been an excellent education.
Thank you very much it was very helpful. Continue the hard wok :)
Keep supporting ❤️
Easy to learn 👍🏻
Glad to hear that
Can you please do KMeans next?
Suggestion noted!
Check out my new video on K-means...
ua-cam.com/video/IB9WfafBmjk/v-deo.html
@@NormalizedNerd Hey !!! Can you please do a video on GBDT or XGBoost ?
Thanks !!
Awesome video!! Can you please to a video on using KNN for a high dimensional database?
I think sklearn should be used for higher dimensional data.
@@NormalizedNerd I'm not really familiar in this field of study but in my current project, we have to use KNN for a database that has the dimension of 520 columns, I have heard of preprocessing approaches to reduce the dimensions of the database like by removing the less "important" features but I'm not really sure how KNN is used in this scenario, do you have any suggestion?
The trick is to reduce the number of features using PCA or (and) tSNE. Then you can apply KNN. As a rule of thumb, you should reduce the dimension below 50.
Good music haha
lmaooooooo