[R] Changes to batchSOM from 1.9.1 to 2.0.1

dana@accelrys.com dana at accelrys.com
Tue Apr 19 20:12:22 CEST 2005


Has the algorithm used by batchSOM for hexagonal topology changed in some 
way between R 1.9.1 and 2.0.1?  In comparing between the two versions, I 
get identical results for rectangular topology, but very different results 
for hexagonal topology.  (I tried to find release notes for the VR bundle 
that might explain the changes, but was unable to locate these anywhere.)

Here's the script I use:

# input data from rinput1 file
rdata <- NULL
rdata <- read.table("c:/temp/A8A.tmp", header=TRUE, sep=",")

# 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 = FALSE)

And here are the first few lines of the (large) data file A8A.tmp:

ALogP,Molecular_Weight,Num_H_Donors,Num_H_Acceptors,Num_RotatableBonds,Num_Atoms,Num_Rings,Num_AromaticRings
4.216,322.35781,0,4,6,24,2,2
5.752,429.38372,2,4,9,26,2,2
4.425,341.48871,1,5,10,22,1,1
4.366,327.46213,1,5,11,21,1,1
0.261,254.16304,0,8,5,18,2,2
6.45,316.47912,0,0,2,24,5,2

If I compare the A8F.tmp output files produced by 1.9.1 and 2.0.1, they 
look very different.

Thanks,
Dana Honeycutt




More information about the R-help mailing list