ssh/ssh_phase_diagram_multiprocessing.py
def k_means(eigenval, eigenvec, cutoff=0.2):
    """ computes the clusters in eigenvector space using information in eigenvalues (last step in spectral clustering)
    Args:
        eigenval (np.array): eigenvalues of random walk laplacian
        eigenvec (np.array): eigenvectors of random walk laplacian
        cutoff (float): the number of eigenvalues below the cutoff is the number of clusters used in the k means clustering

    Returns:
        tuple: output of k means clustering (cluster centers, cluster label, inertia)

    """
    n_clusters = np.sum(eigenval < cutoff)
    k_means_clustered = cluster.k_means(eigenvec[:, :n_clusters], n_clusters=n_clusters)
    return k_means_clustered
 computes the clusters in eigenvector space using information in eigenvalues (last step in spectral clustering)
    Args:
        eigenval (np.array): eigenvalues of random walk laplacian
        eigenvec (np.array): eigenvectors of random walk laplacian
        cutoff (float): the number of eigenvalues below the cutoff is the number of clusters used in the k means clustering

    Returns:
        tuple: output of k means clustering (cluster centers, cluster label, inertia)

    
computes the clusters in eigenvector space using information in eigenvalues (last step in spectral clustering)
computes the clusters in eigenvector space using information in eigenvalues ( last step in spectral clustering )
def k_means(eigenval, eigenvec, cutoff=0.2):
    n_clusters = np.sum(eigenval < cutoff)
    k_means_clustered = cluster.k_means(eigenvec[:, :n_clusters], n_clusters=n_clusters)
    return k_means_clustered
def k_means ( eigenval , eigenvec , cutoff = 0.2 ) : n_clusters = np . sum ( eigenval < cutoff ) k_means_clustered = cluster . k_means ( eigenvec [ : , : n_clusters ] , n_clusters = n_clusters ) return k_means_clustered
computes the clusters in eigenvector space using information in eigenvalues (last step in spectral clustering)
computes the clusters in eigenvector space using information in eigenvalues ( last step in spectral clustering )
""" computes the clusters in eigenvector space using information in eigenvalues (last step in spectral clustering)
    Args:
        eigenval (np.array): eigenvalues of random walk laplacian
        eigenvec (np.array): eigenvectors of random walk laplacian
        cutoff (float): the number of eigenvalues below the cutoff is the number of clusters used in the k means clustering

    Returns:
        tuple: output of k means clustering (cluster centers, cluster label, inertia)

    """
output of k means clustering (cluster centers, cluster label, inertia)
output of k means clustering ( cluster centers cluster label inertia )
tuple
eigenval
eigenvalues of random walk laplacian
eigenvalues of random walk laplacian
eigenvec
eigenvectors of random walk laplacian
eigenvectors of random walk laplacian
cutoff
the number of eigenvalues below the cutoff is the number of clusters used in the k means clustering
the number of eigenvalues below the cutoff is the number of clusters used in the k means clustering