Self-organizing maps (SOMs) are a type of neural network that clusters and categorizes the data without supervision. It starts from a random set of groupings and competitively updates the values in the network to eventually match those in the distribution of the training data. In this way, it learns the clusters in the data by looking at the attributes of the data.
Incanter has an easy-to-use implementation of SOMs. We'll use it here to look for clusters in the Iris dataset.
First, we'll need to have these dependencies in our project.clj
file.
:dependencies [[org.clojure/clojure "1.4.0"] [incanter "1.4.1"]]
We'll need to have these libraries loaded into our script or REPL.
(require '[incanter.core :as i] '[incanter.som :as som] 'incanter.datasets)
And, we'll use the Iris dataset.
(def iris (incanter.datasets/get-dataset :iris))