A classification of companies into sectors of the economy is important for macroeconomic analysis and for investments into the sector-specific financial indices and exchange traded funds (ETFs). Major industrial classification systems and financial indices have historically been based on expert opinion and developed manually. Here we show how unsupervised machine learning can provide a more objective and comprehensive broad-level sector decomposition of stocks. An emergent low-dimensional structure in the space of historical stock price returns automatically identifies "canonical sectors" in the market, and assigns every stock a participation weight into these sectors. Furthermore, by analyzing data from different periods, we show how these weights for listed firms have evolved over time.