Algorithmic approach to the statistical inference of non-Boolean function classes