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

refactor feature importance code #28

Closed
hbaniecki opened this issue Jan 14, 2023 · 0 comments · Fixed by #52
Closed

refactor feature importance code #28

hbaniecki opened this issue Jan 14, 2023 · 0 comments · Fixed by #52
Assignees
Labels
maintenance 🔨 Code enhancements, tests and maintenance

Comments

@hbaniecki
Copy link
Member

  1. rename permutation to _permutation_, times to _times_ and reference to _reference_ to omit potential problems with feature names
    raw$permutation <- rep(1:B, each = length(times))

    cbind(data.frame(times = times), "_full_model_" = loss_full, loss_variables, "_baseline_" = loss_baseline)
  2. use ret[['_reference_']] instead of ret[, ncol(ret)] for readability and code robustness
    res[, 2:(ncol(res) - 3)] <- res[, 2:(ncol(res) - 3)] / res[, (ncol(res))]
  3. sort the result by _permutation_ after merge() like it is done in type="raw"
    res <- merge(res, res_full, by = "times")
@hbaniecki hbaniecki added the maintenance 🔨 Code enhancements, tests and maintenance label Jan 14, 2023
@mikolajsp mikolajsp self-assigned this Feb 10, 2023
@mikolajsp mikolajsp linked a pull request Feb 16, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance 🔨 Code enhancements, tests and maintenance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants