Company Embedding via Heterogeneous Graph Neural Networks: Link Prediction on the Warsaw Stock Exchange
DOI:
https://doi.org/10.15611/eada.2026.3.02Keywords:
graph neural networks, company embedding, heterogeneous graph, link prediction, Warsaw Stock ExchangeAbstract
Aim: This article examines whether heterogeneous graph neural networks trained by link prediction can produce embeddings of companies listed on the Warsaw Stock Exchange (GPW) that capture industry structure and economic similarity.
Methodology: A heterogeneous graph was built from the National Court Register (KRS) records of 370 GPW main-market companies (October 2026) and 638 activity codes of the PKD 2025 classification with their hierarchy (1,322 nodes, 4,322 edges). The proposed framework, COGRE (Company Organisation Graph Representation Embedding), trains a heterogeneous GraphSAGE encoder to predict each company’s primary activity code. Four hypotheses were tested: COGRE predicts activity codes better than an XGBoost classifier (H1) and then a perceptron that uses the same features without message passing (H2); its embeddings match PKD sections more closely than alternative company representations (H3); and the stock returns of a company’s nearest neighbours in embedding space move more closely with its own than those of peer companies from the same industry (H4). The models were compared by Bayesian signed-rank tests on five cross-validation folds.
Results: COGRE reached a mean AUC-ROC of 0.897, against 0.804 for XGBoost and 0.743 for the perceptron, although XGBoost ranked the correct code higher (mean reciprocal rank 0.238 vs. 0.131). The embeddings agreed more closely with PKD sections (normalised mutual information 0.403) than raw capital-structure variables (0.114), graph-structure features (0.107) and text-only embeddings (0.301). Embedding neighbours co-moved more than random companies, but not detectably more than PKD-division peer companies.
Implications and recommendations: Registry-based embeddings recovered industry structure better than their separate inputs and identified peer companies comparable to those of an official classification, while providing a continuous measure of similarity. The framework can incorporate financial statements, richer text and ownership relations.
Originality/value: Company embeddings produced by a graph neural network are the research output rather than an intermediate step towards price or risk prediction, and were validated on market data that the model never observed.
Downloads
References
Alford, A. W. (1992). The effect of the set of comparable firms on the accuracy of the price-earnings valuation method. Journal of Accounting Research, 30(1), 94–108. https://doi.org/10.2307/2491093
Balmaseda, V., Coronado, M., & Cadenas-Santiago, G. de. (2023). Predicting systemic risk in financial systems using deep graph learning. Intelligent Systems with Applications, 19, 200240. https://doi.org/10.1016/j.iswa.2023.200240
Benavoli, A., Corani, G., Demšar, J., & Zaffalon, M. (2017). Time for a change: A tutorial for comparing multiple classifiers through Bayesian analysis. Journal of Machine Learning Research, 18(77), 1–36. http://jmlr.org/papers/v18/16-305.html
Bhojraj, S., Lee, C. M. C., & Oler, D. K. (2003). What’s my line? A comparison of industry classification schemes for capital market research. Journal of Accounting Research, 41(5), 745–774. https://doi.org/10.1046/j.1475-679X.2003.00122.x
Bi, W., Xu, B., Sun, X., Wang, Z., Shen, H., & Cheng, X. (2022). Company-as-tribe: Company financial risk assessment on tribe-style graph with hierarchical graph neural networks. Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, 2712–2720. https://doi.org/10.1145/3534678.3539129
BiznesRadar.pl. (2026). Notowania i profile spółek GPW. https://www.biznesradar.pl/gielda/akcje_gpw
Cao, L., Ehrenheim, V. von, Granroth-Wilding, M., Stahl, R. A., McCornack, A., Catovic, A., & Rocha, D. D. C. (2025). CompanyKG: A large-scale heterogeneous graph for company similarity quantification. IEEE Transactions on Big Data, 11(1), 247–258. https://doi.org/10.1109/TBDATA.2024.3407573
Chen, T., & Guestrin, C. (2016). XGBoost: A scalable tree boosting system. Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 785–794. https://doi.org/10.1145/2939672.2939785
Chen, Y., Wei, Z., & Huang, X. (2018). Incorporating corporation relationships via graph convolutional neural networks for stock price prediction. Proceedings of the 27th ACM International Conference on Information and Knowledge Management, 1655–1658. https://doi.org/10.1145/3269206.3269269
Das, S., Huang, X., Adeshina, S., Yang, P., & Bachega, L. (2023). Credit risk modeling with graph machine learning. INFORMS Journal on Data Science, 2(2), 197–217. https://doi.org/10.1287/ijds.2022.00018
Dolphin, R., Smyth, B., & Dong, R. (2022). Stock embeddings: Learning distributed representations for financial assets. https://arxiv.org/abs/2202.08968
Dolphin, R., Smyth, B., & Dong, R. (2023). A machine learning approach to industry classification in financial markets. In Artificial intelligence and cognitive science (pp. 81–94). Springer. https://doi.org/10.1007/978-3-031-26438-2_7
Dong, Y., Chawla, N. V., & Swami, A. (2017). metapath2vec: Scalable representation learning for heterogeneous networks. Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 135–144. https://doi.org/10.1145/3097983.3098036
Efron, B., & Tibshirani, R. J. (1994). An introduction to the bootstrap. Chapman; Hall/CRC. https://doi.org/10.1201/9780429246593
Feng, B.-J., Cheng, X., Xu, H.-N., & Xue, W.-F. (2024). Corporate credit ratings based on hierarchical heterogeneous graph neural networks. Machine Intelligence Research, 21(2), 257–271. https://doi.org/10.1007/s11633-023-1425-9
Fey, M., & Lenssen, J. E. (2019). Fast graph representation learning with PyTorch Geometric. ICLR Workshop on Representation Learning on Graphs and Manifolds.
García-Durán, A., & Niepert, M. (2018). KBLRN: End-to-end learning of knowledge base representations with latent, relational, and numerical features. Proceedings of the 34th Conference on Uncertainty in Artificial Intelligence (UAI 2018), 372–381. https://arxiv.org/abs/1709.04676
Gilmer, J., Schoenholz, S. S., Riley, P. F., Vinyals, O., & Dahl, G. E. (2017). Neural message passing for quantum chemistry. Proceedings of the 34th International Conference on Machine Learning, 1263–1272.
Główny Urząd Statystyczny. (2025a). Klucze przejścia (powiązań) PKD 2007 – PKD 2025. https://klasyfikacje.stat.gov.pl/static/pkd_25/pdf/klucze_powiazan_PKD_2007_PKD_2025.pdf
Główny Urząd Statystyczny. (2025b). PKD 2025: Biuletyn informacji publicznej. https://bip.stat.gov.pl/dzialalnosc-statystyki-publicznej/rejestr-regon/pkd-2025/
Główny Urząd Statystyczny. (2025c). Polska klasyfikacja działalności PKD 2025. https://klasyfikacje.stat.gov.pl/static/pkd_25/pdf/KlasyfikacjaPKD2025.pdf
Grover, A., & Leskovec, J. (2016). node2vec: Scalable feature learning for networks. Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 855–864. https://doi.org/10.1145/2939672.2939754
Hamilton, W. L., Ying, R., & Leskovec, J. (2017). Inductive representation learning on large graphs. Advances in Neural Information Processing Systems, 30, 1024–1034.
Hoberg, G., & Phillips, G. (2016). Text-based network industries and endogenous product differentiation. Journal of Political Economy, 124(5), 1423–1465. https://doi.org/10.1086/688176
Hu, Z., Dong, Y., Wang, K., & Sun, Y. (2020). Heterogeneous graph transformer. Proceedings of the 2020 World Wide Web Conference, 2704–2710. https://doi.org/10.1145/3366423.3380027
Kim, R., So, C. H., Jeong, M., Lee, S., Kim, J., & Kang, J. (2019). HATS: A hierarchical graph attention network for stock movement prediction. https://arxiv.org/abs/1908.07999
Kristiadi, A., Khan, M. A., Lukovnikov, D., Lehmann, J., & Fischer, A. (2019). Incorporating literals into knowledge graph embeddings. The Semantic Web (ISWC 2019), 347–363. https://doi.org/10.1007/978-3-030-30793-6_20
Lachaud, G., Conde-Cespedes, P., & Trocan, M. (2022). Comparison between inductive and transductive learning in a real citation network using graph neural networks. 2022 IEEE/ACM International Conference on Advances in Social Networks Analysis and Mining (ASONAM), 534–540.
Lee, C. M. C., Ma, P., & Wang, C. C. Y. (2015). Search-based peer firms: Aggregating investor perceptions through internet co-searches. Journal of Financial Economics, 116(2), 410–431. https://doi.org/10.1016/j.jfineco.2015.02.003
Li, C.-T., Tsai, Y.-C., Chen, C.-Y., & Liao, J. C. (2025). Graph neural networks for tabular data learning: A survey with taxonomy and directions. ACM Computing Surveys, 58(1), 1–51. https://doi.org/10.1145/3744918
Liu, J., Nissim, D., & Thomas, J. (2002). Equity valuation using multiples. Journal of Accounting Research, 40(1), 135–172. https://doi.org/10.1111/1475-679X.00042
McInnes, L., Healy, J., & Melville, J. (2018). UMAP: Uniform manifold approximation and projection for dimension reduction. https://arxiv.org/abs/1802.03426
Ministerstwo Sprawiedliwości. (2026). Otwarte API krajowego rejestru sądowego: Odpisy aktualne. https://prs.ms.gov.pl/krs/openApi
Patel, M., Jariwala, K., & Chattopadhyay, C. (2025). A systematic review on graph neural network-based methods for stock market forecasting. ACM Computing Surveys, 57(2), 1–38. https://doi.org/10.1145/3696411
Perozzi, B., Al-Rfou, R., & Skiena, S. (2014). DeepWalk: Online learning of social representations. Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 701–710. https://doi.org/10.1145/2623330.2623732
Reimers, N., & Gurevych, I. (2019). Sentence-BERT: Sentence embeddings using Siamese BERT-networks. Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), 3982–3992. https://doi.org/10.18653/v1/D19-1410
Reimers, N., & Gurevych, I. (2020). Making monolingual sentence embeddings multilingual using knowledge distillation. Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), 4512–4525. https://doi.org/10.18653/v1/2020.emnlp-main.365
Schlichtkrull, M., Kipf, T. N., Bloem, P., Berg, R. van den, Titov, I., & Welling, M. (2018). Modeling relational data with graph convolutional networks. The Semantic Web (ESWC 2018), 593–607. https://doi.org/10.1007/978-3-319-93417-4_38
Takayanagi, T., Sakaji, H., & Izumi, K. (2024). SETN: Stock embedding enhanced with textual and network information. https://arxiv.org/abs/2408.02899
Vamvourellis, D., Tóth, M., Bhagat, S., Desai, D., Mehta, D., & Pasquali, S. (2024). Company similarity using large language models. 2024 IEEE Symposium on Computational Intelligence for Financial Engineering and Economics (CIFEr), 1–9. https://doi.org/10.1109/CIFEr62890.2024.10772990
Wang, J., Zhang, S., Xiao, Y., & Song, R. (2022). A review on graph neural network methods in financial applications. Journal of Data Science, 20(2), 111–134. https://doi.org/10.6339/22-JDS1047
Wang, X., Ji, H., Shi, C., Wang, B., Ye, Y., Cui, P., & Yu, P. S. (2019). Heterogeneous graph attention network. Proceedings of the 2019 World Wide Web Conference, 2022–2032. https://doi.org/10.1145/3308558.3313562
Wilcoxon, F. (1945). Individual comparisons by ranking methods. Biometrics Bulletin, 1(6), 80–83. https://doi.org/10.2307/3001968
Wu, Y., & Wang, Z. (2018). Knowledge graph embedding with numeric attributes of entities. Proceedings of the Third Workshop on Representation Learning for NLP, 132–136. https://doi.org/10.18653/v1/W18-3017
Wu, Z., Pan, S., Chen, F., Long, G., Zhang, C., & Yu, P. S. (2021). A comprehensive survey on graph neural networks. IEEE Transactions on Neural Networks and Learning Systems, 32(1), 4–24. https://doi.org/10.1109/TNNLS.2020.2978386
Xiang, S., Cheng, D., Shang, C., Zhang, Y., & Liang, Y. (2022). Temporal and heterogeneous graph neural network for financial time series prediction. Proceedings of the 31st ACM International Conference on Information & Knowledge Management, 3584–3593. https://doi.org/10.1145/3511808.3557089
Xu, K., Hu, W., Leskovec, J., & Jegelka, S. (2019). How powerful are graph neural networks? Proceedings of the 7th International Conference on Learning Representations (ICLR 2019).
Xu, K., Li, C., Tian, Y., Sonobe, T., Kawarabayashi, K., & Jegelka, S. (2018). Representation learning on graphs with jumping knowledge networks. Proceedings of the 35th International Conference on Machine Learning, 5453–5462.
Yahoo Finance. (2026). Historical prices and company information for GPW-listed shares, retrieved with the finance library (version 1.7.0). https://finance.yahoo.com
Ye, X., Liu, D., Li, T., & Li, W. (2025). Heterogeneous business network based interpretable competitive firm identification: A graph neural network method. Annals of Operations Research, 347(2), 1133–1161. https://doi.org/10.1007/s10479-025-06476-0
Zakrzewska, A., & Fraszka-Sobczyk, E. (2024). Verification of neural network models for forecasting the volatility of the WIG20 index rates of return during COVID-19 pandemic. International Journal of Applied Decision Sciences. https://doi.org/10.1504/IJADS.2024.10051016
Zheng, Y., Lee, V. C. S., Wu, Z., & Pan, S. (2021). Heterogeneous graph attention network for small and medium-sized enterprises bankruptcy prediction. In Advances in knowledge discovery and data mining (pp. 140–151). Springer. https://doi.org/10.1007/978-3-030-75762-5_12
Zhong, H., & Liu, C. (2024). Firm profiling and competition assessment: A design science approach. Information & Management, 61(5), 103988. https://doi.org/10.1016/j.im.2024.103988
Downloads
Published
Issue
Section
Categories
License
Copyright (c) 2026 Filip Wójcik

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Accepted 2026-10-27
Published 2026-12-04







