bids.modeling.statsmodels.BIDSStatsModelsNode

class BIDSStatsModelsNode(level, name, model, group_by, transformations=None, contrasts=None, dummy_contrasts=False)[source]

Represents a single node in a BIDS-StatsModel graph.

Parameters:
  • level (str) – The BIDS keyword to use as the grouping variable; must be one of [‘run’, ‘session’, ‘subject’, or ‘dataset’].

  • name (str) – Name to assign to the node.

  • model (dict) – The ‘model’ part of the BIDS-StatsModels specification.

  • transformations (dict) – Optional dictionary specifying transformations to apply. Dictionary must include “transformer” and “instructions” keys. “transformer” indicates the specification to follow. “instructions” is a list of instructions matching that specification.

  • contrasts (list) – List of contrasts to apply to the parameter estimates generated when the model is fit.

  • dummy_contrasts (dict) – Optional dictionary specifying which conditions to create indicator contrasts for. Dictionary may include a “test” key (‘t’), and optionally a subset of “conditions”.

  • group_by ([str]) – Optional list of strings giving the names of entities that define the grouping structure for all variables. The current node will be executed separately for each unique combination of levels specified in group_by. For example, if group_by=[‘contrast’, ‘subject’], and there are 2 contrasts and 3 subjects, then there will be 6 separate iterations, and the returned list will have 6 elements. Any value passed here will be overridden if one is passed when run() is called on a node.

Methods

add_child(edge)

Add an edge to a child node.

add_collections(collections)

Add BIDSVariableCollections (i.e., predictors) to the current node.

add_parent(edge)

Add an edge to a parent node.

get_collections(**filters)

Returns BIDSVariableCollections at the current node. :param filters: Optional keyword filters used to constrain which of the available collections get returned (e.g., passing subject=['01', '02'] will return collections for only subjects '01' and '02'). :type filters: dict.

run([inputs, group_by, force_dense, ...])

Execute node with provided inputs.

__init__(level, name, model, group_by, transformations=None, contrasts=None, dummy_contrasts=False)[source]

Methods

__init__(level, name, model, group_by[, ...])

add_child(edge)

Add an edge to a child node.

add_collections(collections)

Add BIDSVariableCollections (i.e., predictors) to the current node.

add_parent(edge)

Add an edge to a parent node.

get_collections(**filters)

Returns BIDSVariableCollections at the current node. :param filters: Optional keyword filters used to constrain which of the available collections get returned (e.g., passing subject=['01', '02'] will return collections for only subjects '01' and '02'). :type filters: dict.

run([inputs, group_by, force_dense, ...])

Execute node with provided inputs.