This function uses package self-organized maps to find clusters in satellite image time series to cluster the samples. It also evaluates the quality of each sample using SOM properties.
The results is a list with three members: (1) the samples tibble, with one additional column indicating to which neuron it has been mapped; (2) the Kohonen map, used for plotting and cluster quality measures; (3) a tibble with the labelled neurons, where each class of each neuron is associated to two values: (a) the prior probability that this class belongs to a cluster based on the frequency of samples of this class allocated to the neuron; (b) the posterior probability that this class belongs to a cluster, using data for the neighbours on the SOM map.
sits_som_map(
data,
grid_xdim = 10,
grid_ydim = 10,
alpha = 1,
rlen = 100,
distance = "euclidean",
som_radius = 2,
mode = "online"
)
A tibble with samples to be clustered.
X dimension of the SOM grid (default = 25).
Y dimension of the SOM grid.
Starting learning rate (decreases according to number of iterations).
Number of iterations to produce the SOM.
The type of similarity measure (distance).
Radius of SOM neighborhood
Type of learning algorithm (default = "online")
A list of tibbles containing statistics about the samples and the neuron in each iteration.
`kohonen` package (https://CRAN.R-project.org/package=kohonen)
# NOT RUN {
# Produce a cluster map
som_cluster <- sits_som_map(samples_modis_4bands)
# plot the som map
plot(som_cluster)
# Clean the samples to get better quality ones
clean_samples <- sits_som_clean_samples(som_cluster)
# }
Run the code above in your browser using DataLab