Machine learning classifies catalytic-reaction mechanisms