Re: [R] KNN

2018-06-21 Thread Jeff Reichman
David I figured out where I went wrong. But thank you for the response Jeff -Original Message- From: David L Carlson Sent: Thursday, June 21, 2018 11:43 AM To: reichm...@sbcglobal.net; R-help@r-project.org Subject: RE: [R] KNN It depends on what you are trying to do and what kind of

Re: [R] KNN

2018-06-21 Thread Eivind K. Dovik
Yes, however using caret you can do it directly using the preProcess parameter, e.g. train(y ~., data = train, method = "knn", preProcess = c("center", "scale")). Hope this helps. Eivind On Thu, 21 Jun 2018, Jeff Reichman wrote: R-Help Does one need to normalize ones data is using the

Re: [R] KNN

2018-06-21 Thread David L Carlson
8 11:36 AM To: R-help@r-project.org Subject: [R] KNN R-Help Does one need to normalize ones data is using the knn function within the caret Library. Jeff [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -

[R] KNN

2018-06-21 Thread Jeff Reichman
R-Help Does one need to normalize ones data is using the knn function within the caret Library. Jeff [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/

Re: [R] KNN

2016-02-25 Thread Alnazer Elbedairy
said, your function does not do this. It does not even run > kNN. > > > > - > > David L Carlson > > Department of Anthropology > > Texas A&M University > > College Station, TX 77840-4352 > > > > -Original Message-

Re: [R] KNN

2016-02-25 Thread Ben Tupper
> David L Carlson > Department of Anthropology > Texas A&M University > College Station, TX 77840-4352 > > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Jim Lemon > Sent: Thursday, February 25, 2016 4:15 AM > To: A

Re: [R] KNN

2016-02-25 Thread Alnazer
Appreciated Jim. Alnazer Elbedairy > On Feb 25, 2016, at 4:15 AM, Jim Lemon wrote: > > Hi Alnazer, > I'm not surprised that it didn't do what you expected. Even if I clean > up the code so that it will actually run: > > majorityGuessing<-function(trainingData,categories) { > GuessMPG<-sample(

Re: [R] KNN

2016-02-25 Thread David L Carlson
list Subject: Re: [R] KNN Hi Alnazer, I'm not surprised that it didn't do what you expected. Even if I clean up the code so that it will actually run: majorityGuessing<-function(trainingData,categories) { GuessMPG<-sample(1:length(categories),nrow(trainingData),replace=TRUE) ret

Re: [R] KNN

2016-02-25 Thread Jim Lemon
Hi Alnazer, I'm not surprised that it didn't do what you expected. Even if I clean up the code so that it will actually run: majorityGuessing<-function(trainingData,categories) { GuessMPG<-sample(1:length(categories),nrow(trainingData),replace=TRUE) return(GuessMPG) } and call it like this (ass

Re: [R] KNN

2016-02-24 Thread Alnazer Elbedairy
Dear Jim thanks you for your kind help. KNN - is K- Nearest Neighbor, is a technique used in Machine Learning. attached you will find a CSV file dataset, my question is : use the attached Dataset, Use majority guessing technique to evaluate KNN ? this is the solution I came up with, but I didn't wo

Re: [R] KNN

2016-02-24 Thread Jim Lemon
Hi Alnazar, I looked at your question yesterday and was unable to find what a "majority guessing" function is. I think it may be related to the "Pandemonium" model of decision making, but that doesn't get me very far. Could you give us a hint as to what this function is? Jim On Wed, Feb 24, 2016

Re: [R] KNN

2016-02-24 Thread David L Carlson
hropology Texas A&M University College Station, TX 77840-4352 -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Alnazer Sent: Tuesday, February 23, 2016 2:03 PM To: r-help@r-project.org Subject: [R] KNN How I can use majority guessing function to evaluate

[R] KNN

2016-02-24 Thread Alnazer
How I can use majority guessing function to evaluate KNN, if I have data saved in CSV file Alnazer Elbedairy __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gu

Re: [R] knn - random result although use.all=TRUE

2015-11-20 Thread David L Carlson
.org] On Behalf Of itziar irigoien Sent: Thursday, November 19, 2015 7:10 AM To: r-help@r-project.org Subject: [R] knn - random result although use.all=TRUE Dear all, I have this toy example to work with k-nn classification approach. (My data, code and results are at the end of the message) Wor

[R] knn - random result although use.all=TRUE

2015-11-19 Thread itziar irigoien
Dear all, I have this toy example to work with k-nn classification approach. (My data, code and results are at the end of the message) Working with knn function in library class and setting the parameter use.all=TRUE, I would not expect a random answer. Nevertheless I get a different answer ea

[R] Knn Probability Attributes:

2015-01-16 Thread Greg
Dear R Geniuses: I'm a C++ and Perl, not an R System consultant, but a client wants me to see if R can help him predict whether daily sales for some auto parts stores will be less than, greater, or equal to the median daily sales value. (equal to is defined as within 2%, otherwise there would nev

[R] Knn by using R

2013-03-12 Thread eliza botto
Dear useRs, I have a matrix which contains population data at 12 points of every station. In total there are 179 stations. So, its a matrix of 179 columns and 12 rows. Through a self inventory distance calculation method, a distance matrix was prepared for this data. Now i want to do k-neares

[R] R KNN Regression Help

2012-11-15 Thread bonjovi
hanks,Bonjovi -- View this message in context: http://r.789695.n4.nabble.com/R-KNN-Regression-Help-tp4649638.html Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]] __ R-help@r-project.org mailing

[R] knn density estimation in R

2011-11-15 Thread lyh123985458
How to do the nearest neighbor density estimation in R? Is there any function/package to perform k-Nearest Neighbor based density estimation in R Thank you very much! Thanks to a dozen of volunteer moderators! [[alternative HTML version deleted]] _

Re: [R] KNN script: Identity of specific K samples chosen?

2009-05-14 Thread Max Kuhn
> 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? You would

[R] KNN script: Identity of specific K samples chosen?

2009-05-14 Thread Ryan van Laar
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/r

Re: [R] knn class probabilities

2008-10-01 Thread Max Kuhn
On Tue, Sep 30, 2008 at 8:06 PM, Mike Fugate <[EMAIL PROTECTED]> wrote: > Good Day, > > I'm using the knn function in the package class. With k set to 3, the > function returns proportions of 1/3, 0.5, 0.6, 2/3, 3/4, and 1.0 for the > test cases. I don't understand how with k set to 3 the proport

[R] knn class probabilities

2008-10-01 Thread Mike Fugate
Good Day, I'm using the knn function in the package class. With k set to 3, the function returns proportions of 1/3, 0.5, 0.6, 2/3, 3/4, and 1.0 for the test cases. I don't understand how with k set to 3 the proportions can be anything other than 1/3, 2/3, or 1.0 I've seen similar inco