Compressed Sparse Code Hierarchical Self-Organizing Map (CoSCo-HSOM) is an extension of ideas existent in the gesture classification and recognition research area. Building on Hierarchical Self-Organizing systems and cognitive models introduced by neuropsychologists, we present the CoSCo-HSOM algorithm introducing novel features to the previously published sparse encoding HSOM model. During the training phase we use activity lists, i.e., ordered lists of recently activated nodes on each level, instead of activity level based encoding of short term memory. Furthermore, we present how HSOMs can be used to learn and reproduce a generalized task on the Nao humanoid robot, using only the initial posture of the robot. The effectiveness of CoSCo-HSOM is supported through a comparative analysis with the Gaussian Mixture Model approach, on the same task using the same training data.