# Machine Learning and Zombie Firms Classification
## 3 Data and Methodology
### Methodology  
Our study introduced an innovative approach for predicting zombie firms using the random forest model, one of the most remarkable tree-based machine learning models. Tree-based algorithms are characterized by a high flexibility, performance, and interpretability. Tree-based algorithms partition the feature space into a set of rectangles. Each node is divided into only two branches. Figure 3 shows a part of our tree in the random forest model. The top node partitions the samples based on their EBIT. The samples whose EBIT is smaller than 0.007 are sent to the left node and are partitioned based on their net income at this node.  
One major problem with the tree model is its high variance. Small changes in the explanatory variables often result in very different predictions because of the model's hierarchical nature. If small changes result in different nodes on the top split, it propagates down to all the splits below, which makes the ultimate leaf and prediction different from the original. One way to reduce such variance is by averaging many trees.  
The random forest model builds a large number of de-correlated trees and averages them. Each tree uses bootstrapped samples to build models. Bootstrapping samples allows for decreasing the correlation between trees and decreasing the variance of the model. After building each model, predictions are made by the majority vote of the trees. Each tree votes for one prediction class, and the most predicted class becomes the ultimate decision.  
Figure 3: Part of our tree model. This figure shows the top part of the tree in our random forest model to predict FN zombies. According to this tree, samples whose EBIT is lower than 0.007 go to the left down node. Then, they are partitioned again based on the net income. As this figure shows, tree model partitions the feature space into a set of rectangles.  
The tree model can calculate the variable importance. At each split in a tree, the improvement in the target class purity is the importance measure attributed to the splitting variable. Because the random forest model contains many trees, the variable importance of each tree is aggregated, and we can calculate the volatility of this importance. Although the procedure of bootstrapping the samples carries the risk that some variables are not used in the trees, setting the number of trees can exclude the situation of one variable not being used in all trees.  
In the main analysis, we built the prediction models for FN zombie firms and CHK zombie firms separately. We only used financial accounts data, without including data on the policy interest rate. The input data were all financial accounts presented in the Appendix A normalized by total assets, and the financial accounts of profits and costs normalized by sales.  
External factors such as macroeconomic variables, which show the economic conditions, may affect a firm's viability. However, we did not include macroeconomic variables as input data, because these are common to all firms. Our purpose was to identify zombie firms individually so that common variables are less effective for such classification. In addition, if these factors are crucial for firm viability, we can extract them from financial accounts, because they affect the firms' performance and are reflected in the financial accounts as a result.  
The optimal number of trees and total leaves in each tree were not clear. Therefore, we performed cross-validation based on the test period. We set the minimum number of trees to 100 and the maximum number of trees to 300. The minimum number of leaves in each tree was set to 40 and the maximum number was 600. We picked the best hyperparameters of the model that had the best prediction performance in the test period.