Пример #1
0
def manual(data, *args, **kwargs):
    """Sort spikes manually by cluster cutting
    
    Opens a new window in which you can draw cluster of arbitrary
    shape.
    
    Notes
    -----
    Only two first features are plotted
    """

    return manual_sort._cluster(data[:, :2])
Пример #2
0
def manual(data, *args, **kwargs):
    """Sort spikes manually by cluster cutting
    
    Opens a new window in which you can draw cluster of arbitrary
    shape.
    
    Notes
    -----
    Only two first features are plotted
    """

    return manual_sort._cluster(data[:, :2])
Пример #3
0
def manual(data, n_spikes='all', *args, **kwargs):
    """Sort spikes manually by cluster cutting

    Opens a new window in which you can draw cluster of arbitrary
    shape.

    Notes
    -----
    Only two first features are plotted
    """
    if n_spikes == 'all':
        return manual_sort._cluster(data[:, :2], **kwargs)
    else:
        idx = np.argsort(np.random.rand(data.shape[0]))[:n_spikes]
        labels_subsampled = manual_sort._cluster(data[idx, :2], **kwargs)
        try:
            neigh = neighbors.KNeighborsClassifier(15)
        except NameError:
            raise NotImplementedError(
                "scikits.learn must be installed to use subsampling")
        neigh.fit(data[idx, :2], labels_subsampled)
        return neigh.predict(data[:, :2])
Пример #4
0
def manual(data, n_spikes='all', *args, **kwargs):
    """Sort spikes manually by cluster cutting

    Opens a new window in which you can draw cluster of arbitrary
    shape.

    Notes
    -----
    Only two first features are plotted
    """
    if n_spikes=='all':
        return manual_sort._cluster(data[:, :2], **kwargs)
    else:
        idx = np.argsort(np.random.rand(data.shape[0]))[:n_spikes]
        labels_subsampled = manual_sort._cluster(data[idx, :2], **kwargs) 
        try:
            neigh = neighbors.KNeighborsClassifier(15)
        except NameError:
            raise NotImplementedError(
                "scikits.learn must be installed to use subsampling")
        neigh.fit(data[idx, :2], labels_subsampled)
        return neigh.predict(data[:, :2])