楼主: hanszhu
2476 1

Self- and Super-organizing Maps in R: The kohonen Package [推广有奖]

  • 0关注
  • 34粉丝

已卖:4535份资源

院士

27%

还不是VIP/贵宾

-

TA的文库  其他...

Clojure NewOccidental

Job and Interview

Perl资源总汇

威望
7
论坛币
144575308 个
通用积分
68.9538
学术水平
37 点
热心指数
38 点
信用等级
25 点
经验
31240 点
帖子
1873
精华
1
在线时间
802 小时
注册时间
2005-1-3
最后登录
2024-10-15

楼主
hanszhu 发表于 2015-2-11 00:38:33 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

Authors:

Ron Wehrens, Lutgarde M. C. Buydens

Title:

[download]
(22675)
Self- and Super-organizing Maps in R: The kohonen Package

Reference:

Vol. 21, Issue 5, Oct 2007Submitted 2007-05-04, Accepted 2007-10-08

Type:

Article

Abstract:

In this age of ever-increasing data set sizes, especially in the natural sciences, visualisation becomes more and more important. Self-organizing maps have many features that make them attractive in this respect: they do not rely on distributional assumptions, can handle huge data sets with ease, and have shown their worth in a large number of applications. In this paper, we highlight the kohonen package for R, which implements self-organizing maps as well as some extensions for supervised pattern recognition and data fusion.

Paper:

[download]
(22675)
Self- and Super-organizing Maps in R: The kohonen Package
(application/pdf, 1 MB)

Supplements:

[download]
(1747)
kohonen_2.0.0.tar.gz: R source package
(application/x-gzip, 603.5 KB)

[download]
(1757)
v21i05-figures.R: R code for producing the figures from the paper
(application/zip, 1.1 KB)

[download]
(1843)
v21i05.R: R example code from the paper
(application/zip, 1.3 KB)

Resources:

BibTeX | OAI

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Organizing package super maps Self especially attractive important features natural

沙发
hanszhu 发表于 2015-2-11 00:39:57
  1. library("kohonen")
  2. data("wines")
  3. wines.sc <- scale(wines)

  4. set.seed(7)
  5. wine.som <- som(data = wines.sc, grid = somgrid(5, 4, "hexagonal"))
  6. plot(wine.som, main = "Wine data")

  7. ####
  8. readline("Press a key to continue")
  9. data("nir")
  10. attach(nir)
  11. set.seed(13)
  12. nir.xyf <- xyf(data = spectra,
  13.                Y = composition[,2],
  14.                xweight = 0.5,
  15.                grid = somgrid(6, 6, "hexagonal"))
  16. par(mfrow = c(1,2))
  17. plot(nir.xyf, type = "counts", main = "NIR data: counts")
  18. plot(nir.xyf, type = "quality", main = "NIR data: mapping quality")

  19. ####
  20. readline("Press a key to continue")
  21. set.seed(13)
  22. nir.xyf2 <- xyf(data = spectra,
  23.                 Y = classvec2classmat(temperature),
  24.                 xweight = .2, grid = somgrid(6, 6, "hexagonal"))

  25. ####
  26. readline("Press a key to continue")
  27. water.predict <- predict(nir.xyf)$unit.prediction
  28. temp.xyf <- predict(nir.xyf2)$unit.prediction
  29. temp.predict <- as.numeric(classmat2classvec(temp.xyf))

  30. par(mfrow = c(1,2))
  31. plot(nir.xyf, type = "property", property = water.predict,
  32.      main = "Prediction of water content", keepMargins = TRUE)
  33. scatter <- matrix(rnorm(length(temperature)*2, sd=.1), ncol=2)
  34. radii <- (temperature - 20)/250
  35. symbols(nir.xyf$grid$pts[nir.xyf$unit.classif,] + scatter,
  36.         circles = radii, inches = FALSE, add = TRUE)

  37. plot(nir.xyf2, type = "property", property = temp.predict,
  38.      palette.name = rainbow, main = "Prediction of temperatures")
  39. scatter <- matrix(rnorm(nrow(composition)*2, sd=.1), ncol=2)
  40. radii <- 0.05 + 0.4 * composition[,2]
  41. symbols(nir.xyf2$grid$pts[nir.xyf2$unit.classif,] + scatter,
  42.         circles = radii, inches = FALSE, add = TRUE)

  43. ####
  44. readline("Press a key to continue")
  45. par(mfrow=c(1,2))
  46. plot(nir.xyf2, "codes")

  47. ####
  48. readline("Press a key to continue")
  49. data("yeast")
  50. set.seed(7)
  51. yeast.supersom <- supersom(yeast, somgrid(8, 8, "hexagonal"),
  52.                            whatmap = 3:6)
  53. classes <- levels(yeast$class)
  54. colors <- c("yellow", "green", "blue", "red", "orange")
  55. par(mfrow=c(3,2))
  56. plot(yeast.supersom, type = "mapping",
  57.      pch = 1, main = "All", keepMargins = TRUE)
  58. for (i in seq(along = classes)) {
  59.   X.class <- lapply(yeast,
  60.                     function(x) subset(x, yeast$class == classes[i]))

  61.   X.map <- map(yeast.supersom, X.class)
  62.   plot(yeast.supersom, type = "mapping", classif = X.map,
  63.        col = colors[i], pch = 1, main = classes[i], keepMargins = TRUE)
  64. }


  65. ####
  66. readline("Press a key to continue")
  67. graphics.off()
  68. par(mfrow = c(1,3))
  69. plot(wine.som, "changes", main = "Wine data: SOM")
  70. plot(nir.xyf, "changes", main = "NIR data: XYF")
  71. plot(yeast.supersom, "changes", main = "Yeast data: SUPERSOM")


  72. ####
  73. readline("Press a key to continue")
  74. set.seed(7)
  75. training.indices <- sample(800, 400)
  76. training <- rep(FALSE, 800)
  77. training[training.indices] <- TRUE

  78. yeast.ssom1 <- supersom(lapply(yeast, function(x) subset(x, training)),
  79.                         somgrid(4, 6, "hexagonal"),
  80.                         whatmap = 3)
  81. ssom1.predict <- predict(yeast.ssom1,
  82.                          newdata = lapply(yeast,
  83.                            function(x) subset(x, !training)),
  84.                          trainY = subset(classvec2classmat(yeast[[7]]),
  85.                            training))
  86. prediction1 <- factor(classmat2classvec(ssom1.predict$prediction),
  87.                       levels=levels(yeast$class))
  88. confus1 <- table(subset(yeast$class, !training), prediction1)
  89. confus1
  90. sum(diag(confus1))

  91. yeast.ssom2 <- supersom(lapply(yeast, function(x) subset(x, training)),
  92.                         somgrid(4, 6, "hexagonal"),
  93.                         whatmap = 3:6)
  94. ssom2.predict <- predict(yeast.ssom2,
  95.                          newdata = lapply(yeast,
  96.                            function(x) subset(x, !training)),
  97.                          trainY = subset(classvec2classmat(yeast[[7]]),
  98.                            training))
  99. prediction2 <- factor(classmat2classvec(ssom2.predict$prediction),
  100.                       levels=levels(yeast$class))
  101. confus2 <- table(subset(yeast$class, !training), prediction2)
  102. confus2
  103. sum(diag(confus2))
复制代码


您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-31 00:16