You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These functions use NaN masks rather than tiled subsets. The problem with NaN values is that it requires the signal to be converted to a floating-point array (rather than preserving the original dtype if it is integer, boolean, etc.). Now that we are using select_times, these functions should be deprecated (or updated to use select_times under the hood.
The text was updated successfully, but these errors were encountered:
Sample code for doing the split using select times while preserving the function signature for split_by_epochs:
def split_est_val_by_sequence(recording):
epochs = recording.epochs
m = epochs['name'].str.match('^SEQUENCE_')
sequences = recording.epochs.loc[m, 'name'].unique()
np.random.shuffle(sequences)
val_size = round(len(sequences) * 0.2)
val_epochs, est_epochs = sequences[:val_size], sequences[val_size:]
m = epochs['name'].apply(lambda x: x in val_epochs)
val_times = epochs.loc[m][['start', 'end']].values
m = epochs['name'].apply(lambda x: x in est_epochs)
est_times = epochs.loc[m][['start', 'end']].values
val = recording.select_times(val_times)
est = recording.select_times(est_times)
return est, val
These functions use NaN masks rather than tiled subsets. The problem with NaN values is that it requires the signal to be converted to a floating-point array (rather than preserving the original dtype if it is integer, boolean, etc.). Now that we are using
select_times
, these functions should be deprecated (or updated to useselect_times
under the hood.The text was updated successfully, but these errors were encountered: