Skip to content

Instantly share code, notes, and snippets.

@emjun
Created April 28, 2020 00:44
Show Gist options
  • Save emjun/5587174a1f70733eac62478c1989efe7 to your computer and use it in GitHub Desktop.
Save emjun/5587174a1f70733eac62478c1989efe7 to your computer and use it in GitHub Desktop.
Sample for Tea API V1
# Declare Variables, Design, Assumptions, and Hypothesis at the time of construction
import tea
file_path = "./datasets/UScrime.csv"
variables = [{
'name': 'Class',
'data type': 'ordinal',
'categories': ['0', '1', '2']
},
{
'name': 'Score',
'data type': 'numeric'
}]
design = {
'study type': 'experiment',
'independent variable': 'Class',
'dependent variable': 'Score'
}
tea_obj = tea.Tea(vars, design, hypothesis="Score~Class") # No Assumptions
tea_obj.load_data(file_path)
# Can also add Variables, Design, Assumptions, and Hypotheses incrementally
tea_obj = tea.Tea()
tea_obj.load_data(file_path)
vars_obj = tea.define_variables(variables)
design_obj = tea.define_study_design(design, variables)
hypo_obj = tea_obj.hypothesize("Score~Class")
# No Assumptions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment