Welcome to ThinkTogether!¶
Welcome to ThinkTogether’s documentation. ThinkTogether is a light-weight package that implements classes designed to reimagine modular learning, research, and development-oriented inquiry. ThinkTogether embodies and enforces an information hierarchy that segments analysis cleanly into two parts: gathering and processing.
ThinkTogether is an open source project developed by Jarret Petrillo in his research at ThinkEmpire.
Contents¶
Getting Started¶
>> from ThinkTogether import InformationSet, InferenceSet, Collection
ThinkTogether may be imagined as the building blocks of a large-scale research project. The bricks are InformationSets and InferenceSets, and the roof is the Collection, which ties a project together into an easily accessible object. All three classes extend Python’s native dictionary class.
Pattern¶
Be aware that the following example is difficult to understand, and was chosen because it contains all the moving parts of ThinkTogether’s formal system:
>> TREATMENT = InformationSet('TREATMENT', {
'group': ['A','B','A','A',...'B'],
'effect': [0.1, 0.3, 0.15,... 0.3]})
>> Effect = InferenceSet('Effect', TREATMENT)
>> Effect.process(calculate_drug_effect)
>> Effect.inferred()
{'efficacy': 0.88}
- Consider the following use case: a researcher has raw data and wants to infer a result from the raw data. The researcher must:
- Import data.
- Modify/clean dataset.
- Calculate treatment effect.
- Return treatment effect.
- These tasks represent the ‘what’ of the analysis. ThinkTogether answers the question of ‘how’ it should be done to ensure that the resulting code is modular, clear, and reusable:
- Define a ‘load and clean’ function for each data source.
- Load each data source into a separate InformationSet.
- Identify the information needed to perform the desired calculation.
- Create an InferenceSet which wraps the necessary InformationSets.
- Define a ‘process’ function to calculcate the treatment effect.
- Call the InferenceSet process method.
- Return the treatment effect, stored within the InferenceSet object.
