Black-Box Machine Learning Algorithms For Scientific Tasks With Complex Prior Knowledge