Questions tagged [knn]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
4 views

Can KNNImputer be used in filling time series data?

I was wondering whether I could fill some null values in a time series dataset about the air quality of India, with knnimputer. Because it seems reasonable to say some days are similar to each other ...
0
votes
0answers
11 views

in knn regression, is there a way to prefer “well distributed neighbours” of just “nearest” neighbours

Naive nearest neighbours regression will use the k nearest matches. However, this can mean that the matches may be: only on one side of a certain dimension not all dimensions may be represented ...
1
vote
1answer
19 views

Error: Metric Kappa not applicable for regression models

I tried to use KNN methods to do prediction, I have converted factors to character, and my dataset contains both numeric and characteristic variables, missings have been removed. Here are my R codes: <...
0
votes
0answers
12 views

KNN : Error rate goes very high when no of nearest neighbors are increased

I am trying to find out the best value of K nearest neighbors using which my model works best. So I got below graph for various K values. Now, as it is visible from the pic, that model performs best ...
2
votes
2answers
102 views

PCA shows overlapping boundaries, then why SVM performs best

I am trying to understand which model might work for a given problem before trying the models, I find this case against my knowledge. Please guide what I am missing. I am new to Data Science. Here is ...
2
votes
0answers
25 views

Identify the parameter causing the anomaly in a multivariate dataset

I have a payment transaction dataset with a large number of predictor variables. I am trying to build a model for anomaly detection and I have evaluated various algorithms/approaches for the same like ...
3
votes
1answer
32 views

Can I use KNN for inference?

So, I have a dataset with several columns and one output. However, I'm not trying to predict anything, I'm trying to understand each variable relation with the output. Let's say I have a dataset with ...
0
votes
0answers
20 views

Proof regarding the MSE of K-NN

I'm trying to prove this claim: The validation MSE of K-NN with n-fold multiplied by $(k/k+1)^2$, is equal to the training MSE of (K+1)-NN (without cross validation). Would be happy to receive some ...
1
vote
1answer
42 views

How to decide on optimum number of components for KNN classification

I am doing KNN classification using PCA method. For this, I first did PCA on train data and then predicted components for test set using train PCA. So my train PCA plot looks like this: I decided to ...
0
votes
0answers
19 views

Using RBF k-NN graph in spectral clustering

In the article Spectral Clustering with Imbalanced Data there is mentioned usage of a "RBF k-NN" graph. I haven't encountered this kind of graphs before and couldn't google anything related to it. ...
0
votes
0answers
6 views

Understanding weighted (kernelized) k nearest neighbors

In this article I've found a really clean and nice explanation of weighted kNN algorithm, which uses a kernel to compute weights for k nearest neighbors. The very important notation detail is that ...
0
votes
0answers
8 views

Understanding proof of k-nearest neighbors convergence to Bayes Decision boundary

I'm working on the proof that under sufficient regularity conditions k-nearest neighbor converges to the Bayes Decision boundary as n, the number of data points increases. I have read that 1-nearest ...
0
votes
0answers
23 views

Which is the best clustering algorithm for clustering multidimensional data with low density difference?

I am working on a project currently and I wish to cluster multi-dimensional data. I tried K-Means clustering and DBSCAN clustering, both being completely different algorithms. The K-Means model ...
2
votes
1answer
26 views

Underlying similarities between Knn and Least squares

It is mentioned in the ESL book Page 19, that Knn and Least squares end up approximating conditional expectation by averages. To explain the statements in detail, the book mentions 3 equations. The ...
1
vote
0answers
25 views

python find the optimal # of cluster for K-Means algorithm

I have a data that contains 24 features and all features have some missing values. I want to use the impute-KNN algorithm from sklearn to fill the missing values. However, before I do that, I think I ...
0
votes
1answer
47 views

Checking Multicollinearity and building a classification model when dependent is a factor and other independent variables are numerical in r

Problem statement Y - Dependent variable is a factor (with levels A, B, and C) Independent variables are all numerical variables. Important: I have only 70 data points. End Goal: Building a ...
1
vote
0answers
32 views

Why is pooling used with Bidirectional LSTM for Text classification problems (NLP)?

As per my understanding, we use pooling with CNN to downsize matrix dimension which will increase computational efficiency of model and will decrease location sensitivity of model. However, some ...
0
votes
1answer
32 views

Can KD-tree introduce bias to nearest neighbor search?

When performing k-nearest neighbor analysis on a large dataset, using a kd-tree algorithm can greatly speed up the search. I've tried researching this question, but have not found an answer - can the ...
1
vote
1answer
43 views

What is the difference in application between KNN and K-means

I know that KNN is a supervised learning method and K-means is an unsupervised clustering method. I also know their algorithms. What I am confused about is that what is the point having K-means given ...
0
votes
0answers
40 views

Manhattan vs Euclidian Distance Measure [duplicate]

In which case we should pickup Manhattan distance and when we should use euclidian distance measure. To my understanding both are used for continues numeric data(not like cosine or others who works ...
2
votes
0answers
75 views

When to use KNN and when Naive Bayes algorithm

Trying to get clear guidelines on when we should use KNN and when Naive Bayes but not getting anything. The indication I am getting is KNN is a lazy learner and NB is used to spam/ham classification ...
0
votes
1answer
41 views

Selecting Feature weights

I use the knn Classifier for a binary classification problem. To improve the classification results I would like to multiply features by weights that are learned from data. I found different ways to ...
1
vote
0answers
46 views

KNN problem with outlier

May I ask why a KNN model with K = 1 will have a strange blue dot on the left hand side of the Bayes decision and KNN decision boundary? I extracted this picture from the ISLR
1
vote
1answer
299 views

Is K = 1 is good for KNN, when error is min, accuracy is max and even AUROC is Max for that value of K?

I am getting highest Accuracy for K =1 in KNN, Max AUROC, and lowest Error. however, I was taught that when K = 1, then its always going to be over-fitting mode, and hence I am asking the question is ...
0
votes
0answers
12 views

Is there a KNN method, that uses some sort of modell to predict weights for the used predictors?

Imagine a situation like this: You want to predict variable high (metric) by variable weight (metric) and ...