Displaying 20 results from an estimated 3000 matches similar to: "Nearest Neighbor Algorithm in R -- again."
2008 Sep 19
3
How to do knn regression?
Hello,
I want to do regression or missing value imputation by knn. I searched
r-help mailing list. This question was asked in 2005. ksmooth and loess
were recommended. But my case is different. I have many predictors (p>20)
and I really want try knn with a given k. ksmooth and loess use band width to define
neighborhood size. This contrasts to knn's variable band width via fixing
a
2012 Jul 24
3
Nearest Neighbors
I was wondering if there is a way in R to find k nearest neighbors of various
orders, say order 2, 3, or 4. In otherwords neighbors of neighbors of
neighbors. You get the idea. I know that I can use knearneigh(matrix.data,
k) but this only gives me the k nearest neighbors and not of a particular
order.
Thanks in advance.
--
View this message in context:
2003 Nov 05
1
fast nearest-neighbor in R?
Is fast nearest-neighbor functionality available in R?
I was thinking of something along the lines of what's
currently in S+SPATIALSTATS.
Thanks for any information anyone might have on this.
- MZ
2010 May 26
3
cluster analysis and supervised classification: an alternative to knn1?
Hi,
I have a 1.000 observations with 10 attributes (of different types: numeric,
dicotomic, categorical ecc..) and a measure M.
I need to cluster these observations in order to assign a new observation
(with the same 10 attributes but not the measure) to a cluster.
I want to calculate for the new observation a measure as the average of the
meausures M of the observations in the cluster
2004 Jun 22
1
k nearest neighbours
Hi there fellow R-users,
Does anyone know of a function which does exactly what knearneigh{spdep}
(finds the k nearest neighbours) does in the package spdep but for more than
2D data?
Regards
Wayne
KSS Ltd
Seventh Floor St James's Buildings 79 Oxford Street Manchester M1 6SS England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040 Fax: +44 (0) 161 236 6305
2003 Jul 30
3
nested for() loops for returning a nearest point
I'm trying to do the following:
For each ordered pair of a data frame (D1) containing longitudes and
latitudes and unique point IDs, calculate the distance to every point in
another data frame (D2) also containing longitudes, latitudes and point
IDs, and return to a new variable in D1 the point ID of the nearest
element of D2.
Dramatis personae (mostly self-explanatory):
D1$long
2001 Jan 10
2
nearest neighbors
Is there an implementation of a reasonable k-nearest neighbor finder
already in one of the packages?
--
+---------------------------------------------------------------------------+
| Robert Gentleman phone : (617) 632-5250 |
| Associate Professor fax: (617) 632-2444 |
| Department of Biostatistics office: not yet
2004 Jan 27
8
distance between two matrices
Hi all,
Say I have a matrix A with dimension m x 2 and matrix B with
dimension n x 2. I would like to find the row in A that is closest to
the each row in B. Here's an example (using a loop):
set.seed(1)
A <- matrix(runif(12), 6, 2) # 6 x 2
B <- matrix(runif(6), 3, 2) # 3 x 2
m <- vector("numeric", nrow(B))
for(j in 1:nrow(B)) {
d <- (A[, 1] - B[j, 1])^2 + (A[,
2016 Apr 04
4
[Bug 94817] New: Nearest neighbor scaling?
https://bugs.freedesktop.org/show_bug.cgi?id=94817
Bug ID: 94817
Summary: Nearest neighbor scaling?
Product: xorg
Version: unspecified
Hardware: Other
OS: All
Status: NEW
Severity: enhancement
Priority: medium
Component: Driver/nouveau
Assignee: nouveau at
2007 Oct 03
2
Speeding up simulation of mean nearest neighbor distances
I've written the function below to simulate the mean 1st through nth
nearest neighbor distances for a random spatial pattern using the
functions nndist() and runifpoint() from spatsat. It works, but runs
relatively slowly - would appreciate suggestions on how to speed up
this function. Thanks. --Dale
library(spatstat)
sim.nth.mdist <- function(nth,nsim) {
D <- matrix(ncol=nth,
2009 Sep 21
9
Handling missing data
I have to remove missing data both in character and numeric datatype.I tried
using NA condition but it is not working ,please help me to solve this.
--
View this message in context: http://www.nabble.com/Handling-missing-data-tp25530192p25530192.html
Sent from the R help mailing list archive at Nabble.com.
2004 Jul 08
1
k nearest neighbor prediction
Hi there fellow R-users,
Does anyone know if there is a package for k nearest neighbours prediction
as opposed to classification? I have found the package knncat but can't see
a way to adjust it to predict a continuous variable.
Any help would be great,
Regards
Wayne Jones
KSS Ltd
Seventh Floor St James's Buildings 79 Oxford Street Manchester M1 6SS England
Company
2010 Mar 09
1
create picture (k -the nearest neighbours)
Hi
I want to create a nice picture about my result of k -the nearest neighbours
algorithm. Here is my easy code:
#################################
library(klaR)
library(ipred)
library(mlbench)
data(PimaIndiansDiabetes2)
dane=na.omit(PimaIndiansDiabetes2)[,c(2,5,9)]
dane[,2]=log(dane[,2])
dane[,1:2]=scale(dane[,1:2])
zbior.uczacy=sample(1:nrow(dane),nrow(dane)/2,F)
2009 Aug 12
3
Random sampling while keeping distribution of nearest neighbor distances constant.
Dear All,
I cannot find a solution to the following problem although I imagine
that it is a classic, hence my email.
I have a vector V of X values comprised between 1 and N.
I would like to get random samples of X values also comprised between
1 and N, but the important point is:
* I would like to keep the same distribution of distances between the X values *
For example let's say N=10 and
2011 Aug 30
1
ROC plot for KNN
Hi I need some help with ploting the ROC for K-nearest neighbors. Since KNN
is a non-parametric classification methods, the predicted value will be
either 0 or 1.
It will not be able to test for different cutoff to plot ROC. What is the
package or functions I should use to plot ROC for KNN?
Thanks.
Qian
[[alternative HTML version deleted]]
2009 May 14
1
KNN script: Identity of specific K samples chosen?
I am currently doing some prediction work using the knn script in the
'class' package. Does anyone know a way of having R return the IDs (sample
IDs, or column IDs of the training matrix) of the 'k' samples that are
chosen by the algorithm as being nearest to a given test sample?
I have searched/read everything I can about the script, however have not
found anything other than the
2010 Feb 24
1
Sparse KMeans/KDE/Nearest Neighbors?
hi,
I have a dataset (the netflix dataset) which is basically ~18k columns and
well variable number of rows but let's assume 25 thousand for now. The
dataset is very sparse. I was wondering how to do kmeans/nearest neighbors
or kernel density estimation on it.
I tired using the spMatrix function in "Matrix" package. I think I'm able to
create the matrix but as soon as I pass
2011 Feb 18
0
Shared nearest neighbor (SNN) clustering algorithm implementation?
Hello,
is there an implementation available for a shared nearest neighbor
(SNN) clustering algorithm?
//Jay
2002 Apr 10
0
Discriminant Adaptive Nearest Neighbor
Dear R users,
Is there anyone who is aware of a R or S package that has Discriminant
Adaptive Nearest Neighbor (DANN) classification by Hastie and Tibshirani?
I have used the search services in R website but no luck.
Thanks in advance!
Jonathan
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read
2007 Jul 08
0
Is there Discriminant Adaptive Nearest Neighbor classification?
Hello everyone,
Is there anyone who is aware of any R package that has Discriminant
Adaptive Nearest Neighbor (DANN) classification by Hastie and Tibshirani?
Thanks in advance!
Tracy
[[alternative HTML version deleted]]