Data-driven algorithm selection and tuning in optimization and signal processing