The Self-Organizing Map, SOM, is a widely used tool in exploratory data analysis. A major drawback of the SOM has been the lack of a theoretically justified criterion for model selection. Model complexity has a decisive effect on the reliability of visual data analysis, which is a main application of the SOM. In particular, independence of variables cannot be observed unless generalization of the model is good. We describe the maximum likelihood probability density model which follows from the SOM training rule, and show how the density model can be applied to choosing the correct model complexity, based on the method of maximum likelihood.