tisane.SetUp¶
- class tisane.SetUp(name, order=None, cardinality=None, data=None, **kwargs)¶
Bases:
tisane.variable.AbstractVariable
Class for experiment’s environment settings and variables
This can represent time, year, etc.
- Parameters
name (str) – The name of the variable. If you have data, this should correspond to the column’s name. The dataset must be in long format.
order (List, optional) – Use a specific ordering of the values of environment settings.
cardinality (int, optional) – The number of unique values of the variable.
data (DataVector, optional) – For internal use only.
**kwargs (optional) – Additional keyword arguments are not currently implemented, i.e., specifying additional keyword arguments will do nothing.
Examples
Time as a SetUp variable:
>>> import tisane as ts >>> time = ts.SetUp("time")
Year as a SetUp variable, and we know that we have 30 years of data.
>>> year = ts.SetUp("year", cardinality=30)
Suppose we had a sensor in the field somewhere, and the sensor records multiple types of data, such as temperature, humidity, etc., as well as the time for each measurement. We can have
timestamp
a SetUp variable, and we have a temperature for every time stamp.>>> sensor = ts.Unit("sensor") >>> timestamp = ts.SetUp("timestamp") >>> temperature = sensor.numeric("temperature", number_of_instances=timestamp)
Methods
associates_with
(variable)Adds a correlation relationship to a data variable.
causes
(effect)Adds a causes relationship to a data variable.
moderates
(moderator, on)Adds an interaction relationship to a data variable
add_data
get_cardinality