Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add average_method argument to compute_clustering_metrics function #289

Closed
evanroyrees opened this issue Aug 30, 2022 · 0 comments · Fixed by #290
Closed

Add average_method argument to compute_clustering_metrics function #289

evanroyrees opened this issue Aug 30, 2022 · 0 comments · Fixed by #290
Labels
enhancement New feature or request

Comments

@evanroyrees
Copy link
Collaborator

gnmi = normalized_mutual_info_score(
labels_true=labels.true,
labels_pred=labels.pred,
average_method="geometric",
)

Changing the metric normalizer is currently not supported, passing through average_method to compute_clustering_metrics provides access to other normalizers

def compute_clustering_metrics(..., average_method="max"):
    # average_method = 'max' is *Normalized Information Distance (NID)*
    # Follows metric property and range is [0, 1] (Vinh et al. 2010)
    ...
    nmi = normalized_mutual_info_score(
        labels_true=labels.true,
        labels_pred=labels.pred,
        average_method=average_method, # choices: min, geometric, arithmetic, max
    )

average_method choices are listed in github.com/scikit-learn/sklearn/metrics/cluster/_supervised.py#L76-L89

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant