search for: datmat

Displaying 3 results from an estimated 3 matches for "datmat".

Did you mean: datat
2006 Mar 27
2
Clustering question \ dist(datmat)
...re highly apprciated, the code below shows what i have done. clust1<- as.vector(rvm(5,5,15)) clust2<- as.vector(rvm(5,10,15)) clust3<- as.vector(rvm(5,15,15)) clust4<- as.vector(rvm(5,20,15)) clust5<- as.vector(rvm(5,25,15)) data1<- rbind(clust1,clust2,clust3,clust4,clust5) datmat<- matrix(data1,nrow=25,ncol=1,byrow=TRUE) circ.plot(datmat) df<- array(dim=c(25,25)) for (i in 1:25){ for (j in 1:25){ df[i,j]<- 0.5*(1 - cos(datmat[i] - datmat[j])) } } hcA<-hclust(df,method="average") **************...
2006 Jun 07
1
knn - 10 fold cross validation
Hi, I was trying to get the optimal 'k' for the knn. To do this I was using the following function : knn.cvk <- function(datmat, cl, k = 2:9) { datmatT <- (datmat) cv.err <- cl.pred <- c() for (i in k) { newpre <- as.vector(knn.cv(datmatT, cl, k = i)) cl.pred <- cbind(cl.pred, newpre) cv.err <- c(cv.err, sum(cl != newpre)) } k0 <- k[which.min(cv.err)] print(k0) return...
2009 Oct 27
4
automatically adjusting axis limits
Dear R users, I am a newbie. Just switched from MATLAB. So thanks a lot for your patience. I have 50000 spectra collected in field. Each spectra has two columns : Wavelength (56) and the actual measurement. Each measurement came in a different .txt file on disk (50000 files in total). I wrote a script that reads every spectra in a for loop and constructs two variables : Wavelength (56) and