Purpose: Asking disambiguation questions, offering interactions for helping analysts answer those questions, and saving answers to use when inferring a statistical model from a Tisane specification.
The motivating principle behind the interaction model behind Tisane, which includes the GUI and disambiguation questions, is to derive statistical models based on conceptual and data measurement relationships analysts express.
The primary challenge we are trying to address through the Tisane GUI is to (1) suggest potential oversights in initial model specification at the query level based on the variable relationships the analyst expressed and (2) elicit runtime data-specific information (i.e., family and link functions). Both these tasks are necessary in order to generate a final statistical model and ensure that it has statistical conclusion and external validity.
A secondary challenge is to discourage analysts from p-hacking their statistical models. This challenge is already baked into our approach in designing Tisane because analysts author programs that describe variables and variable relationships, not statistical models directly in
In order to address these challenges, we have specific design goals, below.
FEEDBACK REQUESTED: Do you think we should have any additional design goals/requirements?
Feel free to update this list/keep track of them based on the design goals! - If a set of effects (e.g., interaction effects) is not necessary, maybe have an explanation of why that tab isn't necessary/applicable and suggestion for how to update program in order to specify interactions? [Design goal 3]
INFERENCE.md
. For example, only interaction effects with two or more main effects (including the variables included in the query) should be shown as options even though the Tisane compiler passes all possible interactions to the GUI.We might need to update/tweak this data flow design
Here are the sketches we went over August 17
From UIST 2021 submission: https://github.com/emjun/tisane/blob/main/tisane/smt/input_interface.py
- For generating family functions, see LOC. It calls a helper function generate_data_dist_from_facts
, see function definition. This functionality is now found in the Family instances themselves, see family.py
here. Each family has a simulate_data
function that needs to be updated so that the appropriate parameters are passed. It might also make sense to make these simulate_data
functions class functions rather that instance functions.
gui.py
: Main file for controlling GUIexample_inputs/
: Example JSON files for candidate statistical modelsexample.py
: Script to run GUI with data, edit to change the JSON file from example_inputs
used to populate the GUIgenerate_examples.py
: Script for creating the JSON files in example_inputs, calls functions in tisane/main.py
to generate Python dictionary that is cast and output as JSON.gui.gui_components.py
: Stores code for layout of several components and provides an interface to the JSON input filecallbacks.py
: Main file for callbacksfamily_link_function_callbacks.py
: Contains callbacks for the family and link functions tabrandom_effects_callbacks.py
: Contains callbacks for the random effects tabgui.gui_helpers.py
: Functions that are generally helpful for multiple parts of the GUIdefault_explanations.json
: Static text to be used. In certain situations, some of this text may only be displayed if, for example, no interaction effects were generated. For others, such as "link-functions", this text is always displayed as a popover. To include it as a popover, use the keys "header"
and "body"
to specify the popover.The main function for generating JSON from Tisane programs is collect_model_candidates
in tisane/main.py
. The output of this function is a JSON object that can be written out to a local file by calling write_to_json
in tisane/main.py
. The JSON object/file has the following general structure:
# Example taken from gui/example_inputs/main_interaction_random_intercept_slope_correlated.json
{
"input": {
"query": {
"DV": "Time",
"IVs": [
"Word_type"
]
},
"generatedMainEffects": [
"Word_type"
],
"generatedInteractionEffects": [],
"generatedRandomEffects": {
"Subject": [
{
"random intercept": {
"groups": "Subject"
}
},
{
"random slope": {
"iv": "Word_type",
"groups": "Subject"
}
},
{
"correlated": true
}
],
"Word": [
{
"random intercept": {
"groups": "Word"
}
}
]
},
"generatedFamilyLinkFunctions": {
"GaussianFamily": [
"LogitLink",
"LogLogLink",
"ProbitLink",
"CLogLogLink",
"PowerLink",
"IdentityLink",
"OPowerLink",
"LogLink",
"NegativeBinomialLink"
],
"InverseGaussianFamily": [
"LogLink",
"IdentityLink",
"PowerLink"
],
"PoissonFamily": [
"PowerLink",
"LogLink",
"IdentityLink"
],
"TweedieFamily": [
"PowerLink",
"LogLink",
"IdentityLink"
],
"GammaFamily": [
"IdentityLink",
"PowerLink",
"LogLink"
]
},
"measures to units": {
"Time": "Subject",
"Word_type": "Subject"
}
}
}
Code for example gallery, including the ones below: https://github.com/plotly/dash-sample-apps/tree/main/apps
Overall layout with specific regions designated to specific tasks: https://dash-gallery.plotly.host/dash-daq-tektronix350/
app.run_server(debug=False, threaded=True, port=port)
). This will update the app for you as you change the code. More info on dev tools.run tisane/gui/example.py
(I use poetry as my python virutal environment and package manager, so I run from the command line: poetry run python3 gui/example.py
)Dash Bootstrap documentation: https://dash-bootstrap-components.opensource.faculty.ai/docs/
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.