HedType¶
- class HedType(event_manager, name, type_tag='condition-variable')[source]
Manager of a type variable and its associated context.
Methods
|
Create a variable manager for one type-variable for one tabular file. |
Return the type defs names |
|
|
Create a dataframe with the indicated type tag values as factors. |
|
Find a list of the given type tag from a HedTag, HedGroup, or HedString. |
|
Return the HedTypeFactors associated with type_name or None. |
|
Return type variable corresponding to type_value. |
Attributes
- HedType.__init__(event_manager, name, type_tag='condition-variable')[source]¶
Create a variable manager for one type-variable for one tabular file.
- Parameters:
event_manager (EventManager) – Event manager instance
name (str) – Name of the tabular file as a unique identifier.
type_tag (str) – Lowercase short form of the tag to be managed.
- Raises:
On errors such as unmatched onsets or missing definitions.
- HedType.get_type_factors(type_values=None, factor_encoding='one-hot')[source]¶
Create a dataframe with the indicated type tag values as factors.
- Parameters:
type_values (list or None) – A list of values of type tags for which to generate factors.
factor_encoding (str) – Type of factor encoding (one-hot or categorical).
- Returns:
Contains the specified factors associated with this type tag.
- Return type:
DataFrame
- static HedType.get_type_list(type_tag, item)[source]¶
Find a list of the given type tag from a HedTag, HedGroup, or HedString.
- Parameters:
type_tag (str) – a tag whose direct items you wish to remove
item (HedTag or HedGroup) – The item from which to extract condition type_variables.
- Returns:
List of the items with this type_tag
- Return type:
list
- HedType.get_type_value_factors(type_value)[source]¶
Return the HedTypeFactors associated with type_name or None.
- Parameters:
type_value (str) – The tag corresponding to the type’s value (such as the name of the condition variable).
- Returns:
HedTypeFactors or None
- HedType.get_type_value_level_info(type_value)[source]¶
Return type variable corresponding to type_value.
- Parameters:
type_value (str) –
Returns:
- HedType.total_events¶
- HedType.type_variables¶