# Machine Learning for Bankruptcy Prediction in the American Stock Market: Dataset and Benchmarks
###### Abstract  
Predicting corporate bankruptcy is one of the fundamental tasks in credit risk assessment. In particular, since the 2007/2008 financial crisis, it has become a priority for most financial institutions, practitioners, and academics. The recent advancements in machine learning (ML) enabled the development of several models for bankruptcy prediction. The most challenging aspect of this task is dealing with the class imbalance due to the rarity of bankruptcy events in the real economy. Furthermore, a fair comparison in the literature is difficult to make because bankruptcy datasets are not publicly available and because studies often restrict their datasets to specific economic sectors and markets and/or time periods. In this work, we investigated the design and the application of different ML models to two different tasks related to default events: (a) estimating survival probabilities over time; (b) default prediction using time-series accounting data with different lengths. The entire dataset used for the experiments has been made available to the scientific community for further research and benchmarking purposes. The dataset pertains to 8262 different public companies listed on the American stock market between 1999 and 2018. Finally, in light of the results obtained, we critically discuss the most interesting metrics as proposed benchmarks for future studies. bankruptcy prediction; deep learning; multi-head; LSTM; machine learning; stock market +
Footnote †: journal: _Future Internet_  
while making, for example, the wrong prediction on a company that is going to go bankrupt has in general a higher cost than the former. At the same time, as a means of addressing class imbalance, the common metric reported for bankruptcy prediction is the Area Under the Curve (AUC). This, however, can also be misleading since it refers to the overall performance of a classifier without providing details regarding the performance of each class or the confusion matrix. In this research work, we investigated the bankruptcy prediction with machine learning on the American stock market, which represents one of the most important drivers of the world economy. The reasons for this choice are summarized in the following: (a) different kinds of data are available for public companies in the American market: stock prices, accounting variables, and annual and quarterly financial reports. It allows the dataset to be improved in the future; (b) a corporate default in the American stock market can have a large impact on the overall economy. The main contributions of our paper are the following:  
1. We collected a dataset for bankruptcy prediction considering 8262 different companies in the stock market in the time interval between 1999 and 2018. The dataset has been made public ([[https://github.com/sowide/bankruptcy_dataset](https://github.com/sowide/bankruptcy_dataset)]([https://github.com/sowide/bankruptcy_dataset](https://github.com/sowide/bankruptcy_dataset)), accessed on 14 August 2022) for the scientific community for further investigations as a benchmark and thus it can be easily enriched with data coming from other sources pertaining to the same companies. Our dataset faithfully followed the FAIR Data Principles [7]: (a) Findable: our data is indexed in a searchable resource and had a unique and persistent identifier. (b) Accessible: our data is understandable to humans and machines and it is deposited in a trusted repository. (c) Interoperable: we used a formal, accessible, shared, and broadly applicable language for knowledge representation. (d) Reusable: we provided accurate information on provenance and clear usage licenses. 2. We investigated two different bankruptcy prediction tasks: The first task (T1) is the default prediction task which aims to predict the company status in the next year using time series of accounting data or just the last fiscal year available. The second task (T2) is the survival probability prediction task in which the model tries to predict the company status over \(k\) years in the future.