HedType

class HedType(event_manager, name, type_tag='condition-variable')[source]

Manager of a type variable and its associated context.

Methods

HedType.__init__(event_manager, name[, type_tag])

Create a variable manager for one type-variable for one tabular file.

HedType.get_summary()

HedType.get_type_def_names()

Return the type defs names

HedType.get_type_factors([type_values, ...])

Create a dataframe with the indicated type tag values as factors.

HedType.get_type_list(type_tag, item)

Find a list of the given type tag from a HedTag, HedGroup, or HedString.

HedType.get_type_value_factors(type_value)

Return the HedTypeFactors associated with type_name or None.

HedType.get_type_value_level_info(type_value)

Return type variable corresponding to type_value.

HedType.get_type_value_names()

Attributes

HedType.total_events

HedType.type_variables

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:

HedFileError

  • On errors such as unmatched onsets or missing definitions.

HedType.get_summary()[source]
HedType.get_type_def_names()[source]

Return the type defs names

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.get_type_value_names()[source]
HedType.total_events
HedType.type_variables