Sustainable financial markets play an important role in the functioning of human society. Still, the detection and prediction of risk in financial markets remain challenging and draw much attention from the scientific community. Here we develop a new approach based on combined network theory and machine learning to study the structure and operations of financial product markets. Our network links are based on the similarity of firms' products and are constructed using the Securities Exchange Commission (SEC) filings of US listed firms. We find that several features in our network can serve as good precursors of financial market risks. We then combine the network topology and machine learning methods to predict both successful and failed firms. We find that the forecasts made using our method are much better than other well-known regression techniques. The framework presented here not only facilitates the prediction of financial markets but also provides insight and demonstrate the power of combining network theory and machine learning.