You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Proposing a consistent interface for thresholding matrices #38
A number of the reconstruction methods involving creating some matrix and then thresholding it in some way. For some of the techniques we've been looking at (correlation matrix based), the thresholding is basically a researcher degree of freedom. We've implemented thresholding in specific ways for each method, trying to attain some level of generality, but with only two implementations this has already led to different function signatures.
In place of this, it might be more straightforward (and more flexible) to define (in a utilities subfolder, say) a set of thresholding functions, then pass these functions as arguments to the various fit methods.
For example, we might have threshold_on_quantile and threshold_in_range functions, then rewrite the above function signatures to look like:
I like the idea of unifying things like this. However, I don't think passing a function is the most elegant way of doing this. The user would need to do something like
from netrd.utilities import threshold_in_range
...
obj.fit(TS, threshold=threshold_in_range)
I'm going to make a utilities/ subdirectory with the thresholding functions. Do we still want one file per method, or is an omnibus utilities/threshold.py better?
Activity
sdmccabe commentedon Jan 18, 2019
(this might be related to the parameterization question raised in #36)
leotrs commentedon Jan 18, 2019
I like the idea of unifying things like this. However, I don't think passing a function is the most elegant way of doing this. The user would need to do something like
which amounts to two lines changed, OR
which amounts to ugly/long lines. I propose we use strings instead:
In the case we need to send some parameters to the thresholding function, we can expose those too:
sdmccabe commentedon Jan 18, 2019
I'm going to make a
utilities/subdirectory with the thresholding functions. Do we still want one file per method, or is an omnibusutilities/threshold.pybetter?leotrs commentedon Jan 18, 2019
Put all in the same place please.