[R] how to use tune.knn() for dataset with missing values

2005-10-06 Thread uttam . phulwale
Hi Everybody, i again have the problem in using tune.knn(), its giving an error saying missing values are not allowed again here is the script for BreastCancer Data, library(e1071) library(mda) trdata-data.frame(train,row.names=NULL) attach(trdata) xtr - subset(trdata, select = -Class)

[R] how to use tune.knn() for dataset with missing values

2005-10-06 Thread David Meyer
Well, since knn() can't handle incomplete data as it says, you can choose to either omit incomplete observations (e.g., using na.omit()), or to impute the data if the conditions are met (missingness at random, ...); see, e.g., packages cat, mix, norm, and e1071 for that. HTH, David