BatchInstances¶
Group and batch instances based on some some criterion along a new feature axis.
The data will be concatenated and padded along that axis. This can be used in cases where you want to group trials (represented as instances in Neuropype) by certain criteria in the instance.data field (typically Marker, but could be any other attribute). You specify the instance.data field holding the criteria (such as 'Marker'), and a feature axis will be created for each unique value found in that field, and the instances (trials) will be stacked along the corresponding axis based on their value (for example, all trials with marker "A" would go in one axis, all trials with marker "B" in another), etc. This allows you to segregate trials into batches for comparative analysis. (Note that if all you want is the mean of trials matching each criteria, instead of the individual trials themselves, you can used the GroupedMean node.) Version 0.5.1
Ports/Properties¶
data¶
Data to process.
group_by¶
Group instances that have the same value or combination of values for the given instance field(s). If given, then the grouped instances will be batched along a new axis.
verify_unique¶
Ensure that the given fields (if any), are unique within each group. If this is not the case, an error will be thrown.
pad_maxitems¶
Optional max # of items for padding. If this is None, it amounts to the max items in any of the groups. If < 1, then it is taken as a quantile of the item counts (e.g., 0.9 would be 90th percentile). If given as an integer >= 1, it is taken as the max # of items.
pad_value¶
Value to use for padding. This value will be inserted to fill up groups that have less than the max # of items. Can be set to NaN or Inf.
handle_overlength¶
How to handle groups that have more items than pad_maxitems. In the truncate-group modes, the excess items are removed from the group, either at the beginning (-pre variant), or at the end (-post variant). In the drop-group mode, the entire group is dropped from the data set.
new_axis¶
New axis type to insert to index the groups. A new axis of this type will be inserted. You can also specify a desired new label for the axis in here by writing feature.mylabel.
sort_order¶
If alphabetical (default), instance axis elements are returned in alphabetical order, otherwise they are returned in order of first appearance.
set_breakpoint¶
Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.
metadata¶
User-definable meta-data associated with the node. Usually reserved for technical purposes.