Abstract. Spectral methods employing nonstandard polynomial bases, such as Müntz polynomials, have proven effective for accurately solving singular problems. However, due to the absence of theoretical guidance, the key parameter [Formula: see text] that controls the exponents of Müntz polynomials is usually determined empirically through extensive numerical experiments, leading to a time-consuming tuning process. To address this bottleneck, we propose a machine-learning–based optimization framework for the Müntz spectral method. As an illustrative example, we optimize the parameter selection for solving time-fractional partial differential equations (PDEs). Specifically, an artificial neural network (ANN) is employed to predict optimal [Formula: see text] based solely on the time-fractional order [Formula: see text]. The ANN is trained by minimizing the mean solution error on a set of sampled one-dimensional time-fractional convection-diffusion equations. Numerical results for time-fractional PDEs demonstrate that the ANN-based parameter prediction significantly improves the accuracy of the Müntz spectral method. Moreover, the trained ANN generalizes effectively from one-dimensional to two-dimensional cases, highlighting its robustness across spatial dimensions.