I'm currently working my way through some Machine Learning courses and books, and from what I can understand, ML uses a stock of standard functions that are used over and over again. This led me to ask, is there a way to generalise a function instead of specifying it? For example, instead of using linear or logistic or polynomial regression, create an ML algorithm to approximate the best type of function? Is such a thing possible mathematically?
Look into splines which is a quite flexible modeling tool. For instance Flexible and inflexible models in machine learning.