Skip to main content

features.remap_waveform_shape_features

features.remap_waveform_shape_features(df)

Remap ModelSpikeFeatures’s 18 raw waveform columns onto the sparser ModelSpikeShapeFeatures set.

The 14 columns the PCA was run over are redundant: it needs only ~7-8 components for 95% of their variance. Only recovery_time_secs (exact constant offset of trough_time_secs) and peak_val/trough_val/peak_time_secs/ trough_time_secs/tip_time_secs (reparametrised into spike_amplitude/peak_to_trough_ratio_log/spike_width_secs/ predepolarisation_width_secs without losing relative information) are actually dropped. tip_val and the 3 slopes (depolarisation_slope/repolarisation_slope/recovery_slope) are kept unchanged despite correlating with the amplitude/duration columns (r=0.79-0.99) – handy precomputed quantities in their own right, even if not strictly independent information. slowness_s_per_m/ spatial_spread_um (#123) and their _std counterparts (#127) are geometric, postdate that PCA redundancy analysis and were not part of it, and are also kept unchanged.

Parameters

Name Type Description Default
df pandas.DataFrame Must contain the columns of ModelSpikeFeatures (e.g. the output of spike, raw or denoised). slowness_s_per_m/spatial_spread_um (#123) and their _std counterparts (#127), all nullable, are treated as all-NaN if altogether absent, so data saved before they existed can still be remapped. required

Returns

Name Type Description
pandas.DataFrame Columns of ModelSpikeShapeFeatures, same index as df.