Performs a grid search over resolution parameters and selects the one that maximizes the silhouette score.
optimize_resolution(
g,
distance_matrix,
target_clusters = 80,
resolution_range_low = 0.1,
resolution_range_high = 0.5,
max_steps = 20,
ncores = 1
)A list containing:
results: data.frame with Resolution, ClusterCount, Silhouette
partitions: list of membership vectors for each resolution
best_resolution: optimal resolution parameter
best_partition: membership vector at optimal resolution
best_clusters: number of clusters at optimal resolution
An igraph graph object with weighted edges
The distance matrix (as dist object) used for silhouette calculation
Target number of clusters for initial tuning. Default is 80.
Fractional range below tuned resolution. Default is 0.1.
Fractional range above tuned resolution. Default is 0.5.
Maximum steps for initial tuning. Default is 20.
Number of cores for parallel processing. Default is 1.
detect_communities_leiden, igClust