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

Running metric_melt several times #51

Open
michaelbornholdt opened this issue Apr 23, 2021 · 3 comments
Open

Running metric_melt several times #51

michaelbornholdt opened this issue Apr 23, 2021 · 3 comments

Comments

@michaelbornholdt
Copy link
Collaborator

This is an optimization issue.
When running metrics such as precision-recall or enrichment, like in the demo book: https://github.com/cytomining/cytominer-eval/blob/master/demos/CellPainting_Demo.ipynb
You call evaluate several times to calculate the metric at different value of p e.g.

for p in np.arange(0.99, 0.96, -0.01):
    r = evaluate(
        profiles=df,
        features=features,
        meta_features=meta_features,
        replicate_groups=["Metadata_gene_name"],
        operation="enrichment",
        similarity_metric="pearson",
        enrichment_percentile = p,
    )
    result.append(r)

However, this calls the function cytominer_eval.transform.get_pairwise_metric several times (once per call of evaluate). This is not necessary since the metrics can be retrieved from the same similarity_melted_df!!

We need to adapt the function evaluate such that it either only calculates the pairs once, when called several times. Or we maybe just need to change the demos to show that when calculating several values, you must not use evaluate for them.

What are your thoughts @gwaygenomics

@gwaybio
Copy link
Member

gwaybio commented Apr 23, 2021

nice! Love this. Maybe, for example, enrichment_percentile can accept a list?

@michaelbornholdt
Copy link
Collaborator Author

mh, yea we could to that. Same goes for Precision recall then.
It could accept a list of k's

You think that's the best solution?

@gwaybio
Copy link
Member

gwaybio commented Apr 23, 2021 via email

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

No branches or pull requests

2 participants