Many problems in science and engineering require the efficient numericalapproximation of integrals, a particularly important application being thenumerical solution of initial value problems for differential equations. Forcomplex systems, an equidistant discretization is often inadvisable, as iteither results in prohibitively large errors or computational effort. To thisend, adaptive schemes have been developed that rely on error estimators basedon Taylor series expansions. While these estimators a) rely on strongsmoothness assumptions and b) may still result in erroneous steps for complexsystems (and thus require step rejection mechanisms), we here propose adata-driven time stepping scheme based on machine learning, and morespecifically on reinforcement learning (RL) and meta-learning. First, one orseveral (in the case of non-smooth or hybrid systems) base learners are trainedusing RL. Then, a meta-learner is trained which (depending on the system state)selects the base learner that appears to be optimal for the current situation.Several examples including both smooth and non-smooth problems demonstrate thesuperior performance of our approach over state-of-the-art numerical schemes.The code is available under https://github.com/lueckem/quadrature-ML.