In this article, we consider the problem of inferring the sign of a link based on known sign data in signed networks. Regarding this link sign prediction problem, signed directed graph neural networks (SDGNNs) provides the best prediction performance currently to the best of our knowledge. In this article, we propose a different link sign prediction architecture called subgraph encoding via linear optimization (SELO), which obtains overall leading prediction performances compared to the state-of-the-art algorithm SDGNN. The proposed model utilizes a subgraph encoding approach to learn edge embeddings for signed directed networks. In particular, a signed subgraph encoding approach is introduced to embed each subgraph into a likelihood matrix instead of the adjacency matrix through a linear optimization (LO) method. Comprehensive experiments are conducted on five real-world signed networks with area under curve (AUC), F1, micro-F1, and macro-F1 as the evaluation metrics. The experiment results show that the proposed SELO model outperforms existing baseline feature-based methods and embedding-based methods on all the five real-world networks and in all the four evaluation metrics.