Dimensionality hyper-reduction and machine learning for dynamical systems with varying parameters