{'fraction_non_alphanumeric': 0.034634760705289674, 'fraction_numerical': 0.006297229219143577, 'mean_word_length': 5.566115702479339, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Predicting Profitability Using Machine Learning

Out-of-sample prediction of profitability is a critical step in fundamental analysis and yet even sophisticated regression models do not generate predictions that significantly outperform random walk predictions. We employ random forests with classification trees, a method from machine learning, to generate out-of-sample predictions of directional changes (increases or decreases) in five profitability measures, return on equity (ROE), return on assets (ROA), return on net operating assets (RNOA), cash flow from operations (CFO), and free cash flow (FCF). With a minimum set of independent variables, and out-of-sample, our method achieves classification accuracies ranging from 57 – 64% for our profitability measures, compared to 50% for the random walk. The difference in proportions of accurate classifications is highly significant. Out-of-sample classification accuracy is similar over forecast horizons of 1 to 5 years. We observe better performance on cash flow measures than on traditional, earnings-based profitability measures. Also, accruals show strong incremental ability beyond cash flows in predicting future cash flows. We find predictive accuracy is highest for firms with high and low accruals-to-market and earnings-to-market ratios, exceeding 75% in one instance. Importantly, our method is insensitive to outliers; our method used data that had not been winsorized or standardized. These results suggest that machine learning methods offer better predictive performance than traditional regression-based methods.