The paper evaluates, from a sustainable finance viewpoint, a machine learning
model implemented in a fintech platform, whose aim is to assign credit ratings. The aim of
the model is to learn from both micro economic data and macro economic trends the credit
rating of companies that ask for credit. We show that the proposed model is able to reward
the companies that have better financial performances with better ratings and, therefore,
a higher probability/lower cost of obtaining credit. At the same time, the model correctly
takes into account the overall evolution of the economy, favoring financial inclusion for the
more penalised economic sectors, particularly during crisis times. The model, its application
to credit rating, and its evaluation, are illustrated with reference to more than 100,000
European companies before and during the COVID-19 pandemic crisis. The results shows
that, while the impact of the financial variables does not change over time, and particularly
during the pandemic, the impact of sectors changes considerably, favoring financial inclusion
and resilience.