In order to investigate a dataset, a model-independent or non-parametric approach has been widely used in cosmology. In these scenarios, the data used directly to reconstruct an underlying function. In this work, we introduce a novel semi-model- independent method to accomplish this task. The new approach not only removes some drawbacks of previous methods but also has some remarkable advantages. We combine the well-known Gaussian linear model with a neural network and introduce a procedure for the reconstruction of an arbitrary function. In our scenario, the neural network produces some arbitrary base functions which are subsequently fed to the Gaussian linear model. Given a prior distribution on the free parameters, the Gaussian linear model provides a closed form for the posterior distribution. In addition, unlike other methods, it is straightforward to compute the uncertainty of the reconstructed function.