As the fundamental infrastructure of the Internet, the optical network carries a great amount of Internet traffic. There would be great financial losses if some faults happen. Therefore, fault location is very important for the operation and maintenance in optical networks. Due to complex relationships among each network element in topology level, each board in network element level, and each component in board level, the concrete fault location is hard for traditional method. In recent years, machine learning, especially deep learning, has been applied to many complex problems, because machine learning can find potential non-linear mapping from some inputs to the output. In this paper, we introduce supervised machine learning to propose a complete process for fault location. Firstly, we use data preprocessing, data annotation, and data augmentation in order to process original collected data to build a high-quality dataset. Then, two machine learning algorithms (convolutional neural networks and deep neural networks) are applied on the dataset. The evaluation on commercial optical networks shows that this process helps improve the quality of dataset, and two algorithms perform well on fault location.