Let's say I have a set $I$ of input parameters, a set $J$ of output parameters, and a set $N$ of experiments that relates $I$ to $J$ for each $n\in N$.
When I train the algorithm how can I ensure that there is a certain smoothness in the solution given? Let me explain what I mean by that with an example: if for $i_1,i_2 \in I$, I have the corresponding output $f(i_1)$ and $f(i_2)$, and if I join $i_1$ and $i_2$ by a straight line in my multi-dimensional domain I need the function $f(i)$ to behave smoothly or 'nicely' between these values, for instance monotonically.
What I want to avoid in my function is having a 'spiked' surface that for a certain element $j\in J$ has several $i^* \in I$ such that $f(i^*)=j$ and these $i^*$ are distributed randomly on the domain I.
I think that my options are imposing that the training algorithm takes this into account as it reads the sample data, or creating first my predictive function $f$ and then use a second algorithm to smooth it, trying to maintain its predictive capabilities.
Any opinion on how to approach or rethink this is welcomed.