code
stringlengths
3
6.57k
method (abs(kurtosis)
fastica.fit_transform(data)
print('fastica niters: %d' % (fastica.n_iter_)
ValueError('Invalid ICALIB %r' % ICALIB)
RuntimeError('Need at least 3 columns')
abs(kurtosis)
IC (column)
scipy.stats.kurtosis(X, axis=0)
abs(k)
argsort()
abs(kurtosis)
print('Sort by abs(kurtosis)
print(k[ki])
IC (column)
core.negentropy(X, axis=0)
assert (ne > 0)
all()
ne.argsort()
print('Sort by negentropy:')
print(ne[nei])
pl.figure()
pl.imshow(pm)
pl.colorbar()
pl.title('original projmatrix')
pl.figure()
pl.imshow(pm[:, ki])
pl.colorbar()
pl.title('decreasing abs(kurtosis)
pl.figure()
pl.imshow(pm[:, nei])
pl.colorbar()
pl.title('decreasing negentropy projmatrix')
ValueError('Unknown kind %r' % kind)
print('Output shape for %s: %r' % (kind, X.shape)
print('%s took %.3f sec' % (kind, time.time()
list(np.unique(spikes['nid'][sids])
update_comppos(X, sids)
get_rms_error(self, sids, tis=None, chans=None)
waveforms (all from the same cluster)
np.unique(spikes['nid'][sids])
len(nids)
RuntimeError("Spikes must all belong to the same (non-junk)
np.asarray([0, nt])
print('tis: %r' % (tis,)
self.get_common_chans(sids, chans)
len(chans)
len(sids)
RuntimeError("Spikes have no common chans for RMS error")
list(tis)
list(chans)
np.zeros((nspikes, nchans, nt)
enumerate(sids)
spikechans.searchsorted(chans)
get_wave()
wave.chans.searchsorted(chans)
np.float64(wave.data[chanis, ti0:ti1])
se.mean(axis=2)
mean(axis=1)
np.sqrt(mse)
get_common_chans(self, sids, chans=None)
time.time()
zip(chanss, nchanss)
print('Building chanslist took %.3f sec' % (time.time()
util.intersect1d_uint8(chanslist)
len(chans)
np.setdiff1d(chans, commonchans)
np.intersect1d(chans, commonchans)
len(diffchans)
print('WARNING: ignored chans %r not common to all spikes' % list(diffchans)
get_Xhash(self, kind, sids, tis, chans, npcsperchan, norm)
hashlib.md5()
h.update(kind.encode()
h.update(sids)
h.update(tis)
h.update(chans)
h.update(str(npcsperchan)
encode()
h.update(str(norm)
encode()
h.hexdigest()
create_neuron(self, id=None, inserti=None)
RuntimeError('Neuron %d already exists' % id)
int(id)
Neuron(self, id)
self.norder.append(neuron.id)
self.norder.insert(inserti, neuron.id)
remove_neuron(self, id)
self.norder.remove(id)
except (KeyError, ValueError)
shift(self, sids, nt)
core.shiftpad(wd[sid], nt)
intround(nt * self.tres)
util.alignbest_cy()
alignbest(self, sids, tis, chans)
len(sids)
len(chans)
print('subntdiv2 on either side of t=0: %d' % subntdiv2)
ValueError("Selected waveform duration too short")
range(-maxshift, maxshift+1)
len(shifts)