Reasonable credit risk assessment for small and Medium-sized enterprises can not only facilitate the financing of enterprises, but also further reduce the credit risk faced by banks. Therefore, taking the bank statement data of 123 small and Medium-sized enterprises from 2018 to 2020 as the data sample, this paper provides two methods, random forest algorithm and logistic regression, to judge the default risk of small and Medium-sized enterprises, and compares the effects of the two classification algorithms. The final experimental results show that the accuracy rate of the random forest is 84% and the PSI value is 20.7%, while the accuracy rate of logistic regression is 76% and the PSI value is 26.4%. Both the accuracy and stability of the random forest algorithm are better than logistic regression. Therefore, this paper provides a new way to assess the credit risk of small and Medium-sized enterprises, which can effectively solve the current financing difficulties of these enterprises in China.