Statistical pattern analysis (machine learning, or ML) is exceedingly powerful at detecting subtle patterns in data that enable predictive classification; often such patterns are otherwise difficult to see without such computing machinery. To the clinician, if a tool is reliable, it matters little whether the algorithm operates on arbitrary features (hair length, motion artifact). To the basic researcher, however, it is much more valuable to work with physiologically meaningful features. Traditionally functional images of the brain images have been interpreted in a neo-phrenological manner assigning specific functions to isolated brain regions. Usually, this is naïve, as most brain regions participate in a diverse array of tasks, acting as transient networks that are engaged in solving whatever challenge the subject is facing. ML has the power to operate at the more natural network level. Using examples from MRI and EEG, this talk will consider the challenge and power of developing ML tools that perform classification of cognitive states based on optimized feature spaces that embody current knowledge in neuroscience and, in so doing, promote both state detection and discovery.