aepsych icon indicating copy to clipboard operation
aepsych copied to clipboard

Support named outcomes

Open crasanders opened this issue 2 years ago • 0 comments

Currently tell messages have the following format:

{'type': 'tell', 
'message': {'config': {'par1': [123], 'par2': [456]}, 
            'outcome': 789, 
            'model_data': True}, 
'extra_info': {}}

This format only allows for a single, unnamed outcome, and while you can specify multiple outcome types in configs, there is no way to name them. We would like to support multiple named outcomes, with the parameter and outcome names being indicated by the config. For example, we could specify named outcomes in a config like so:

[common]
parnames = [par1, par2]
lb = [0, 1]
ub = [2, 3]
outcome_names = [out1, out2]
outcome_types = [binary, continuous]

And specify named outcomes in tell messages like so:

{'type': 'tell', 
'message': {'config': {'par1': [123], 'par2': [456]}, 
            'outcome': {'out1': [0], 'out2': [789]},
            'model_data': True}, 
'extra_info': {}}

(The server should check whether outcome is a dictionary or a list/scalar to determine if it should use the new or old functionality.)

This would require changes to server.configure, server.tell, and server._config_to_tensor.

crasanders avatar Nov 07 '22 15:11 crasanders