8000 Scale isolated label ASW by mumichae · Pull Request #371 · theislab/scib · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Scale isolated label ASW #371

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

Merged
merged 1 commit into from
Feb 2, 2023
Merged

Scale isolated label ASW #371

merged 1 commit into from
Feb 2, 2023

Conversation

mumichae
Copy link
Collaborator
@mumichae mumichae commented Feb 1, 2023

Isolated label ASW is not scaled, so that the expected output range would be between -1 and +1

# AWS score between isolated label vs rest
if "silhouette_temp" not in adata.obs:
adata.obs["silhouette_temp"] = silhouette_samples(
adata.obsm[embed], adata.obs[label_key]
)
# aggregate silhouette scores for isolated label only
score = adata.obs[adata.obs[label_key] == isolated_label].silhouette_temp.mean()
if verbose:
print(f"{isolated_label}: {score}")
return score

Solution: Add scaling option to metric

@codecov
Copy link
codecov bot commented Feb 1, 2023

Codecov Report

Merging #371 (225adf6) into main (98ee9a2) will increase coverage by 0.05%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #371      +/-   ##
==========================================
+ Coverage   53.13%   53.18%   +0.05%     
==========================================
  Files          22       22              
  Lines        1850     1852       +2     
==========================================
+ Hits          983      985       +2     
  Misses        867      867              
Flag Coverage Δ
unittests 53.18% <100.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
scib/metrics/isolated_labels.py 92.98% <100.00%> (+0.25%) ⬆️

Copy link
Member
@danielStrobl danielStrobl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Was wondering about that test_isolated_labels_silhouette one, it's a duplicate from test_isolated_label_metrics.py, right?

Copy link
Collaborator
@LuckyMD LuckyMD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. The same scaling as in cell type ASW, and it's scaled per label, so each label has equal weight.

@LuckyMD
Copy link
Collaborator
LuckyMD commented Feb 1, 2023

We'll need a new release and then an open problems PR to pin to that release @danielStrobl

@mumichae mumichae merged commit c42935b into main Feb 2, 2023
@mumichae mumichae deleted the fix/scale_isolated_asw branch February 2, 2023 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0