Machine learning prediction of critical transition and system collapse | Synapse