Replace glasso with glassoFast#107
Open
mikemartinez99 wants to merge 3 commits into
Open
Conversation
- Added the `cicero_glasso_fast` wrapper function to call `glassoFast` as such:
```
out <- glassoFast::glassoFast(cov_mat,
rho_mat,
thr = thr)
```
This wrapper is then called in `generate_cicero_models` and `find_distance_parameter` to increase speed of calculation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since graphical lasso does not support multithreading safely as mentioned in #70 , I replaced instances of
glassowithglassoFastfor some moderate speed increases. While the difference is not too extreme, it did shave ~1 hour off my connection calculation time.In
run_cicero.R, I added a wrapper function calledcicero_glasso_fastthat takes as input a covariate matrix, rho matrix and a threshold (ridge term) value. All arguments are synonymous to the originalglassofunction.Then, functions that originally called
glassoinstead call the wrapper function:Functions where
glassowas replaced:find_distance_parameterandgenerate_cicero_models