msaf/algorithms/sf/segmenter.py
def compute_nc(X):
    """Computes the novelty curve from the structural features."""
    N = X.shape[0]
    # nc = np.sum(np.diff(X, axis=0), axis=1) # Difference between SF's

    nc = np.zeros(N)
    for i in range(N - 1):
        nc[i] = distance.euclidean(X[i, :], X[i + 1, :])

    # Normalize
    nc += np.abs(nc.min())
    nc /= float(nc.max())
    return nc
def compute_nc(X):
    N = X.shape[0]
    # nc = np.sum(np.diff(X, axis=0), axis=1) # Difference between SF's

    nc = np.zeros(N)
    for i in range(N - 1):
        nc[i] = distance.euclidean(X[i, :], X[i + 1, :])

    # Normalize
    nc += np.abs(nc.min())
    nc /= float(nc.max())
    return nc
def compute_nc ( X ) : N = X . shape [ 0 ] # nc = np.sum(np.diff(X, axis=0), axis=1) # Difference between SF's nc = np . zeros ( N ) for i in range ( N - 1 ) : nc [ i ] = distance . euclidean ( X [ i , : ] , X [ i + 1 , : ] ) # Normalize nc += np . abs ( nc . min ( ) ) nc /= float ( nc . max ( ) ) return nc
Computes the novelty curve from the structural features.
Computes the novelty curve from the structural features .