I have a data set with four inputs and one output. I need to infer the 4 inputs given an output. What is the best way to do this?
I'm assuming that you mean your inputs are 4-dimensional vectors and your outputs are 1 dimensional vectors. If you think that the output vectors give you enough information to completely determine the inputs (at least approximately), then just treat your 1D "outputs" as inputs and your 4D "inputs" as outputs.
Another case is that very different inputs are mapped to similar outputs in your dataset, and you really just want to compute a prototype input for a given output. For example, you might want to produce an image of the letter "a" from only its one-hot label. There are many ways to do this. Here's one that I think is cool:
First, train a neural net the way you normally would with 4D inputs mapping to 1D outputs. Now let's say you're given a 1D output y. Generate some 4D noise x' and pass it through the net to obtain y'. Now pretend that the values in this input are parameters in your network, and hold your actual parameters constant. Use y and y' to compute a loss, and perform gradient descent on your synthetic input. If you repeat this enough times, you should get something that your network thinks deserves the output y.