geom_class function

Visualization in parallelels coordinates in matrix of each attribute

Visualization in parallelels coordinates in matrix of each attribute

Visualization of the classes corresponding to each neuron of the SOM

geom_class(object_som, class = NULL, x_o = 3, y_o = 5.5, x_e = 3, y_e = 6.3)

Arguments

  • object_som: object of Kohonen package
  • class: categorical vector corresponding to the class of the dataset
  • x_o: x-axis to map the number of observations of each neuron
  • y_o: y-axis to map the number of observations of each neuron
  • x_e: x-axis to map the entropy of each neuron
  • y_e: y-axis to map the entropy of each neuron

Returns

ggplot2 object

Examples

# Creating SOM object iris_som <- kohonen::som(X = as.matrix(iris[1:4]), grid = kohonen::somgrid(xdim = 5, ydim = 5, neighbourhood.fct = "gaussian", topo = "rectangular"), rlen = 100) # Creating ggsom class plot geom_class(iris_som, class = iris$Species, x_o = 1, y_o = 6, x_e = 1.1, y_e = 7.4)

References

ggplot2 package (https://CRAN.R-project.org/package=ggplot2)

Author(s)

Felipe Carvalho, lipecaso@gmail.com