Skip to content

Commit

Permalink
try handling nans differently for cran
Browse files Browse the repository at this point in the history
  • Loading branch information
bcjaeger committed Jan 16, 2024
1 parent a8992f6 commit 45c5613
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 26 deletions.
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 0.1.2
Date: 2024-01-15 23:45:43 UTC
SHA: 6eb9df73e540241691d9c72aade9f9b046b45437
Version: 0.1.3
Date: 2024-01-16 04:06:31 UTC
SHA: a8992f6f66a277109ee0e777113673438a08e27b
3 changes: 2 additions & 1 deletion R/orsf_R6.R
Original file line number Diff line number Diff line change
Expand Up @@ -2664,7 +2664,8 @@ ObliqueForest <- R6::R6Class(

for(j in seq_along(pd_vals[[i]])){

nans <- which(is.nan(pd_vals[[i]][[j]]))
# nans <- which(is.nan(pd_vals[[i]][[j]]))
nans <- which(pd_vals[[i]][[j]]==0)

if(!is_empty(nans)){
pd_vals[[i]][[j]][nans] <- NA_real_
Expand Down
36 changes: 18 additions & 18 deletions man/orsf.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/Forest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,10 +540,10 @@ std::vector<std::vector<arma::mat>> Forest::compute_dependence(bool oobag){
thread.join();
}

// uvec oobag_zeros = find(oobag_denom == 0);
// if(oobag_zeros.size() > 0){
// oobag_denom(oobag_zeros).fill(1.0);
// }
uvec oobag_zeros = find(oobag_denom == 0);
if(oobag_zeros.size() > 0){
oobag_denom(oobag_zeros).fill(1.0);
}

threads.clear();

Expand Down

0 comments on commit 45c5613

Please sign in to comment.