我正在尝试为 som map编写脚本 . 它来自于tutorial . 我的问题是Rstudio不起作用 . 我有这个代码:
require(kohonen)
# Create a training data set (rows are samples, columns are variables
# Here I am selecting a subset of my variables available in "data"
data_train
# Change the data frame with training data to a matrix
# Also center and scale all variables to give them equal importance during
# the SOM training process.
data_train_matrix
# Create the SOM Grid - you generally have to specify the size of the
# training grid prior to training the SOM. Hexagonal and Circular
# topologies are possible
som_grid
# Finally, train the SOM, options for the number of iterations,
# the learning rates, and the neighbourhood are available
som_model
grid=som_grid,
rlen=500,
alpha=c(0.05,0.01),
keep.data &