knn Questions
3
I have bellow python code to build knn graph but I have an error: AttributeError: 'Graph' object has no attribute 'node'. It seems that the nx.Graph() has no node attribute but I don't know what sh...
Kirbie asked 23/10, 2019 at 8:24
2
I have two pandas dataframes. one df(or X) with word2vec embeddings, with shape (50000,200). and another dataframe (or sparse matrix) with 0s and 1s filled. this df is the output of sklearn.preproc...
Indeterminable asked 27/10, 2021 at 6:53
1
Solved
I am looking into using Elastic KNN search feature and from what I see this is how we query ES for KNN search.
GET my-index/_knn_search
{
"knn": {
"field": "image_vector&...
Lyssa asked 9/10, 2023 at 17:21
3
I was using KNN from sklearn and predicted the labels using predict_proba. I was expecting the values in the range of 0 to 1 since it tells the probability for a particular class. But I am only get...
Trinetta asked 31/1, 2017 at 11:9
3
I am using the scikit-learn KNeighborsClassifier for classification on a dataset with 4 output classes. The following is the code that I am using:
knn = neighbors.KNeighborsClassifier(n_neighbors=...
Rodgerrodgers asked 22/3, 2018 at 3:47
5
Solved
I have already pre-cleaned the data, and below shows the format of the top 4 rows:
[IN] df.head()
[OUT] Year cleaned
0 1909 acquaint hous receiv follow letter clerk crown...
1 1909 ask secret...
Influence asked 20/3, 2018 at 23:48
13
Trying to plot the decision Boundary of the k-NN Classifier but is unable to do so getting TypeError: '(slice(None, None, None), 0)' is an invalid key
h = .01 # step size in the mesh
# Create colo...
Polyanthus asked 22/3, 2019 at 1:39
3
Solved
I have a time-series dataset with two lables (0 and 1). I am using Dynamic Time Warping (DTW) as a similarity measure for classification using k-nearest neighbour (kNN) as described in these two wo...
Whorl asked 13/7, 2019 at 1:30
2
Solved
I have a matriz ZZ. After I ran prcomp and chose the first 5 PCs I get data_new:
P= prcomp(zz)
data_new = P$x[,1:5]
then I split into training set and test set
pca_train = data_new[1:121,]
pca_...
5
I have 7 classes that needs to be classified and I have 10 features. Is there a optimal value for k that I need to use in this case or do I have to run the KNN for values of k between 1 and 10 (aro...
Calif asked 19/7, 2012 at 20:36
4
I am fitting a k-nearest neighbors classifier using scikit learn and noticed that the fitting is faster, often by an order of magnitude or more, when using the cosine similarity between two vectors...
Fisk asked 23/5, 2021 at 14:32
1
I found this wonderful graph in post here Variation on "How to plot decision boundary of a k-nearest neighbor classifier from Elements of Statistical Learning?". In this example K-NN is u...
Abacist asked 14/12, 2016 at 9:12
3
Solved
Currently I'm doing a project which may require using a kNN algorithm to find the top k nearest neighbors for a given point, say P. im using python, sklearn package to do the job, but our predefine...
3
I want to code my own kNN algorithm from scratch, the reason is that I need to weight the features. The problem is that my program is still really slow despite removing for loops and using built in...
Resiniferous asked 4/8, 2018 at 18:39
3
Solved
This question concerns the implementation of KNN searching of KDTrees. Traversal of a KDTree to find a single best match (nearest neighbor) is straightforward, akin to a modified binary search.
Ho...
Saenz asked 9/1, 2016 at 2:11
1
I want to know the fastest algorithms for obtaining the cartesian distances between each point in a SpatialPointsDataFrame (X) and either (a) the closest point in a second SpatialPointsDataFrame (Y...
1
Solved
I'm using kaggle's pokemon data to practice KNN imputation via preProcess(), but when I did I encountered this following message after the predict() step. I am wondering if I use the incorrect data...
4
Solved
Unlike other algorithms like linear regressions ,KNN doesn't seems to perform any calculation in the training phase. Like in case of linear regressions it finds the coefficients in the training pha...
Efik asked 3/2, 2019 at 17:9
1
Solved
I'm trying to interpret the results I'm getting when trying to cross validate my data for a k-nearest neighbors model. My data set is set up like
variable1(int) | variable2(int) | variable3(int) |...
Wu asked 31/8, 2019 at 17:25
4
I have a dataset that looks like this
1908 January 5.0 -1.4
1908 February 7.3 1.9
1908 March 6.2 0.3
1908 April NaN 2.1
1908 May NaN 7.7
1908 June 17.7 8.7
1908 July NaN 11.0
1908 August 17.5 9.7
1...
Baritone asked 26/7, 2017 at 8:28
2
Solved
I have a 3d point cloud of n points in the format np.array((n,3)). e.g This could be something like:
P = [[x1,y1,z1],[x2,y2,z2],[x3,y3,z3],[x4,y4,z4],[x5,y5,z5],.....[xn,yn,zn]]
I would like to ...
2
Solved
I'm trying to perform my first KNN Classifier using SciKit-Learn. I've been following the User Guide and other online examples but there are a few things I am unsure about. For this post lets use t...
Martens asked 16/11, 2016 at 14:31
2
Solved
I am working on a numerical dataset using KNN Classifier of sklearn package.
Once the prediction is complete, the top 4 important variables should be displayed in a bar graph.
Here is the solutio...
Youthful asked 23/3, 2019 at 13:44
3
I have used knn to classify my dataset. But I do not know how to measure the accuracy of the trained classifier. Does scikit have any inbuilt function to check accuracy of knn classifier?
from skl...
Hovey asked 4/4, 2013 at 20:30
4
Solved
I have problem about calculating the precision and recall for classifier in matlab. I use fisherIris data (that consists of 150 datapoints, 50-setosa, 50-versicolor, 50-virginica). I have classifie...
Demandant asked 7/4, 2014 at 14:14
1 Next >
© 2022 - 2025 — McMap. All rights reserved.