neuroglia.spike.Binner

class neuroglia.spike.Binner(sample_times)[source]

Bin a population of spike events into an array of spike counts.

This transformer converts a table of spike times into a series of spike counts. Spikes are binned according to the spike_times argument.

Parameters:sample_times (array-like) – The samples times that will be used to bin spikes.

Examples

>>> import numpy as np
>>> import pandas as pd
>>> from neuroglia.spike import Binner
>>> binner = Binner(np.arange(0,1.0,0.001))
>>> spikes = pd.DataFrame({'times':np.random.rand})
>>> X = binner.fit_transform(spikes)

Notes

This estimator is stateless (besides constructor parameters), the fit method does nothing but is useful when used in a pipeline.

__init__(sample_times)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

Methods

__init__(sample_times) x.__init__(…) initializes x; see help(type(x)) for signature
fit(X[, y]) Do nothing an return the estimator unchanged.
fit_transform(X[, y]) Fit to data, then transform it.
get_params([deep]) Get parameters for this estimator.
set_params(**params) Set the parameters of this estimator.
transform(X) Bin each neuron’s spikes into a trace of spike counts.