search for: somgrid

Displaying 17 results from an estimated 17 matches for "somgrid".

Did you mean: some_id
2010 Apr 06
2
help output figures in R
somfunc<- function (file) { aa_som<-scale(file) final.som<-som(data=aa_som, rlen=10000, grid=somgrid(5,4, "hexagonal")) pdf(file="/home/cdu/changbin/file.pdf") #output graphic file. plot(final.som, main="Unsupervised SOM") dev.off() } I have many different files, if I want output pdf file with the same name as for each dataset I feed to the function somfunc. HO...
2006 May 09
1
visualisation of Self organising map
Hello R users, I'm using SOM() to cluster a gene expression data set the syntax i used was dataGrid <- c(somgrid(xdim = 3, ydim = 3, topo = c("rectangular","hexagonal"))) dataClusters <- SOM(dataMatrix, grid = dataGrid) plot(dataClusters) it seems that this works just fine but the thing i can't figure out is how to determine where each data point has been clustered. any suggestion...
2009 Nov 28
1
Kohonen Package
...help you can provide will be greatly appreciated! Thanks in advance, Brock >>>>>>>>>>>>>>>>>>>>>>>>>>>>>> library(kohonen) data("wines") wines.sc <- scale(wines) som <- som(wines.sc, grid=somgrid(5, 5, "hexagonal")) plot(som) plot(som, type="dist.neighbours" )
2011 Feb 25
1
kohonen: "Argument data should be numeric"
Hi, I'm trying to utilize the kohonen package to build SOM's. However, trying this on my data I get the error: "Argument data should be numeric" when running the som(data.train, grid = somgrid(6, 6, "hexagonal")) function. As you see, there is a problem with the data type of data.train which is a list. When I try to convert it to "numeric" I get the error: (list) object cannot be coerced to type 'double' What should I do? I can convert the data.train if I ta...
2013 Apr 15
1
Imputation with SOM using kohonen package
...viding some or all data is useful, please let me know if you think it is. # get the data bw <- read.csv("bw.csv") # some missing values in data bwm <- data.frame(na.approx(bw, na.rm=FALSE, rule=2)) bw10 <- bwm[, 1:10] bw10.sc <- scale(bw10) bw.som <- som(data=bw10.sc, grid=somgrid(25,20,'hexagonal')) # playing with diff grid sizes # the different plots of the som at this point show some interesting features to me, but are quite difficult to interpret. # there's much work needed here to understand it, but for now I want to see if it's possible to impute valu...
2010 Mar 30
1
predict.kohonen for SOM returns NA?
...t; set.seed(7) > training <- sample(nrow(wines), 120) > Xtraining <- scale(wines[training, ]) > Xtest <- scale(wines[-training, ], + center = attr(Xtraining, "scaled:center"), + scale = attr(Xtraining, "scaled:scale")) > som.wines <- som(Xtraining, grid = somgrid(5, 5, "hexagonal")) > som.prediction <- predict(som.wines, newdata = Xtest, + trainX = Xtraining, + trainY = factor(wine.classes[training])) > table(wine.classes[-training], som.prediction$prediction) 1 2 3 > som.prediction$prediction [1] NA NA NA NA NA NA NA NA NA NA...
2005 Feb 04
1
Rare Cases and SOM
...for example: InputA<-matrix(cos(1:10),nrow=900,ncol=10,byrow=TRUE) InputB<-matrix(sin(5:14),nrow=100,ncol=10,byrow=TRUE) Input<-rbind(InputA,InputB) I though that a small grid of 3*3 would be enough to extract the patterns in such simple matrix : GridWidth<-3 GridLength<-3 gr <- somgrid(xdim=GridWidth,ydim=GridLength,topo = "hexagonal") test.som <- SOM(Input, gr) par(mfrow=c(GridLength,GridWidth)) for(i in 1:(GridWidth*GridLength)) plot(test.som$codes[i,],type="l") Only when I use a larger grid (say for example 7*3 ) I get some of the representatives for th...
2010 Jun 02
1
how to label the som notes by the majority vote
...x1$outcome[1:20] #self-organizing maps(unsupervised learning) library("kohonen") #SOM, the supervised learning, train the map using outcome as the class variable. set.seed(13) final.xyf<- xyf(data=as.matrix(alex1[,c(1:256)]), Y=classvec2classmat(alex1$outcome), xweight = 0.99, grid=somgrid(20, 30, "hexagonal")) outcome.xyf <- predict(final.xyf)$unit.prediction#get prediction outcome.predict<- as.numeric(classmat2classvec(outcome.xyf)) #change matrix to vectors. outcome.label<-LETTERS[outcome.predict] #conver the numeric value to letters. plot(final.xyf, type=&...
2013 Jul 24
1
Help to improve prediction from supervised mapping using kohonen package
...low the examples in Wehrens and Buydens, 2007, 21(5), J Stat Soft. # somdata[1] is the MEAS_TC variable somX <- scale(training[-1]) somY <- training[[1]] # Needs to return a vector # Train the map (not sure this is how it should be done): tc.xyf <- xyf(data=somX, Y=somY, xweight=0.5, grid=somgrid(6, 6, "hexagonal"), contin=TRUE) # Prediction with test set: tc.xyf.prediction <- predict(tc.xyf, newdata = scale(testing[-1])) # Basic plot: x <- seq(nrow(testing)) plot(x, testing[, "MEAS_TC"], type="l", col="black", ylim=c(0, 3.5)) par(new=TRUE) pl...
2003 Jun 10
1
SOM random seed
Hi all, I have a question about the SOM routine. You can either supply the initial representatives for the lattice yourself or else they are chosen randomly from the dataset. Is it possible to pass the random-seed as an argument somehow, when choosing the random initialisation of the lattice? As it is now, each time I run a SOM on a dataset with the same settings the resulting SOM will still
2003 Oct 15
2
SOM library for R
Hi. Three years ago, I've read the question of availability of SOM library for R using Kohonen's SOM_PAK in this mailing-list. This answer was no availability. And no package dealing with SOM in CRAN. Is this situation same? Could you tell me availability this library? Best Regards.
2006 Feb 27
1
clustering
Hi there, Sorry for the double email. Does R have the packages for the following clustering methods? And if it does, what the commands for them? 1. SOM (Self-organization map) 2. Graph partitioning: 3. Neural network 4. Probability Binning Thank you very much! Linda [[alternative HTML version deleted]]
2008 Mar 02
0
Runtime error
...nd it and know the solution, please contact me... code: results.som <- matrix(NA, 7, 7) results.sil <- matrix(NA, 7, 7) results.dbi <- matrix(NA, 7, 7) results.dun <- matrix(NA, 7, 7) for (i in 8:14){ for (j in 8:14){ # SOM with Kohonen package som <- som(data.scaled, grid = somgrid(i, j, "hexagonal"), radius=j, rlen=1000) # Summary SOM results.som[i-7,j-7] <- mean(som$distances) # Indexes results.sil[i-7,j-7] <- summary(silhouette(som$unit.classif, dist))$avg.width results.dbi[i-7,j-7] <- index.DB(species.data,som$unit.classif)$DB results.du...
2009 Mar 03
1
Self-Organizing Map analysis
Dear list, I read the SOM package manual but I don't understand how to perform (for example) 1) the SOM analysis on Iris data 2) with a visualization similar to that of figure 7 in http://www.cis.hut.fi/projects/somtoolbox/package/papers/techrep.pdf Any suggestion? Thanks in advance, Gianandrea -- View this message in context:
2005 Apr 19
0
Changes to batchSOM from 1.9.1 to 2.0.1
...uot;) # keep only nonzero variance properties rdata <- rdata[, apply(rdata, 2, function(x)any(x[-1] != x[-length(x)])), drop = FALSE] # load SOM package library(class) #set seed for rng set.seed(12345) # calculate SOM gridtopo <- "hexagonal" xdim <- 5 ydim <- 5 gr <- somgrid(xdim = xdim, ydim = ydim, topo = gridtopo) rdata.som <- batchSOM(rdata, gr, c(4, 4, 2, 2, 1, 1, 1, 0, 0)) # write SOM results to stdout rdata.som # write out results write.table(rdata.som$codes, file="c:/temp/A8F.tmp", sep=",", col.names=T, row.names=F, quote=F, append =...
2010 Apr 06
2
help in function in R akin to macro in SAS
...need help to figure the "macro" function in R: I need to plot the different data sets by a plotxyf function, I want the title to be different for different data set. # get the data set final.xyf<- xyf(data=as.matrix(my.final), Y=classvec2classmat(final$outcome), xweight = 0.5, grid=somgrid(5, 4, "hexagonal")) #plot function plotxyf<-function (data) { plot(data, type="mapping", labels=final$target, col=final$outcome+1,, main="Supervised: Mapping plot for data") } #use the plotxyf function. plotxyf(final.xyf)...
2010 Nov 24
0
4. Rexcel (Luis Felipe Parra)-how to run a code from excel
...lowing example code, from the paper of Wehrens and Buydens (http://www.jstatsoft.org/v21/i05/paper): R> library("kohonen") Loading required package: class R> data("wines") R> wines.sc <- scale(wines) R> set.seed(7) R> wine.som <- som(data = wines.sc, grid = somgrid(5, 4, "hexagonal")) R> plot(wine.som, main = "Wine data") I get to have a plot of the codebook vectors of the 5-by-4 mapping of the wine data, and it also includes which variable names correspond to each color. (same picture as in the paper) However, when I run the som() f...