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
fix issue #91 based on discussion in the comments. #140
Conversation
add some helper functions add test for new way of computing feature importance
fix documentation typos [issue #91]
move `flipWeights` to helperFunctions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good. can we update this code to make it easier to read?
R/FeatureImportance.R
Outdated
for (t in 1:num.trees) { | ||
idx.end <- idx.start + num.splits[t] - 1L | ||
unique.projections[idx.start:idx.end] <- | ||
lapply(1:num.splits[t], function(nd) forest$trees[[t]]$matAstore[(forest$trees[[t]]$matAindex[nd] + 1L):forest$trees[[t]]$matAindex[nd + 1L]]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a style thing, but this piece of code would be far easier to read and maintain if we don't deal with indices and reassigning stuff and just append lists together.
pseudo code:
forest_projection = []
for (t in 1:num.trees){
tree_projection = lapply(whatever)
forest_projection = forest_projection + tree_projection
}
Merge RunFeature* into the same file. Update README with correct output names.
* Add Zenodo DOI Badge. (#118) [Closes #74] * Add Zenodo DOI Badge. * Fix link [Closes #74] * speed up travis builds (#125) * removed the distribution and sudo entries from travis config - faster? * adding back sduo false and adding cache packages option * small updates to contributing guide (#133) * add example for running styler move contributing to .github folder * ignore the .github path * fix indexing order of operations error [fixes #119]. (#134) * added functionality to change mtry and sparsity in Urerf (#120) * added functionality to change mtry and sparsity in Urerf * ran styler on modified files and removed white space. * added tests for new RandMat functions. * Added the functionality to splitting based on BIC score using Mclust (#124) * added functionality to change mtry and sparsity in Urerf * Added functionality to split based on BIC score * Add LinearCombo arg to the Urerf fn * Add fast version of BIC * fix some minor errors (#141) Ran through styler and fixed some roxygen import and documentation. * fix issue #91 based on discussion in the comments. (#140) * fix issue #91 based on discussion in the comments. add some helper functions add test for new way of computing feature importance * remove need for library(Matrix) and update function parameteres. fix documentation typos [issue #91] * update test-FeatureImportance move `flipWeights` to helperFunctions * update Feature Importance to be more readable [@ben]. Merge RunFeature* into the same file. Update README with correct output names. * check-as-cran warning will now cause TravisCI to fail. (#142) * Print tree (#136) * added functionality to change mtry and sparsity in Urerf * ran styler on modified files and removed white space. * added tests for new RandMat functions. * added PrintTree function and modified NAMESPACE file to call PrintTree (I'm not sure this last step was necessary but it doesn't hurt. * Add documentation and adjust the formatting of the output. * the double comparison now relies on machine epsilon. (#149) * the double comparison now relies on machine epsilon. * fix for test not passing * move an assignment out of an if condition. (#151) Fixes issue #135 * Packed forest submodule (#152) * add packedForest submodule * update submodule to latest commitadd readme for submodule operations * update submodule readme * update submodule * update submodule (#154) * update submodule (#155) * Draft of v2.0.3 for CRAN (#156) * Draft of v2.0.3 for CRAN no warnings, errors, or notes on my Mac. * run README.Rmd * update submodule (#159)
add some helper functions
add test for new way of computing feature importance