Removing hard dependency to cubature and sklearn