Novartis / torchsurv

Deep survival analysis made easy
https://opensource.nibr.com/torchsurv/
MIT License
47 stars 6 forks source link

Deactive SpearmanCorrcoef() call warning #27

Closed melodiemonod closed 5 days ago

melodiemonod commented 2 months ago

What's the best practice to remove this warning?

>>> from torchmetrics.regression import SpearmanCorrCoef
>>> n = 10
>>> x = torch.randn((n,))
>>> y = torch.randn((n,))
>>> corr = SpearmanCorrCoef()(x, y)
/home/monodme1/.conda/envs/rad-env/lib/python3.10/site-packages/torchmetrics/utilities/prints.py:43: UserWarning: Metric `SpearmanCorrcoef` will save all targets and predictions in the buffer. For large datasets, this may lead to large memory footprint.
  warnings.warn(*args, **kwargs)  # noqa: B028
kruscpe1 commented 2 months ago

This can be suppressed via the warnings package: https://docs.python.org/3/library/warnings.html