<commit_before>sensitivity_BI <- function(dir, newdata, manage, param, n, verbose=FALSE) {
  
  sensitivity_BI_obj <- vector('list', n); gc(FALSE)
  param_values <- seq(
    min(newdata[[manage]][, param]), 
    max(newdata[[manage]][, param]), 
    length=n)
  
  for (i in seq_len(n)) {
    
    inputs <- newdata
    inputs[[manage]][, param] <- param_values[i]
      
    predict_BI_obj <- vector('list', 3); gc(FALSE)
    names(predict_BI_obj) <- c('LDW', 'HDW', 'MAT')
      
    for (j in names(predict_BI_obj)) {
        
      predict_BI_obj_j <- vector('list', 15); gc(FALSE)
        
      for (k in seq_along(predict_BI_obj_j) ) {
          
        predict_BI_obj_jk <- vector('list', 2); gc(FALSE)
          
        if(verbose) cat('Prediction: ')
          
        load(sprintf('%s/%s_%s_%s.rda', dir, manage, j, k))
          
        predict_BI_obj_jk[[1]] <- ((plogis(predict(earth_BI_obj_ijk[[1]], 
          inputs[[manage]])) - .001) / .998); gc(FALSE)
          
        if(verbose) cat(sprintf('%s %s %s %s %s \n', param, i, manage, j, k))
          
        predict_BI_obj_jk[[2]] <- sapply(seq_along(earth_BI_obj_ijk[[2]]), function(REP) {
          ((plogis(predict(earth_BI_obj_ijk[[2]][[REP]], 
            inputs[[manage]])) - .001) / .998)}); gc(FALSE)
          
        rm(earth_BI_obj_ijk)
          
        predict_BI_obj_j[[k]] <- predict_BI_obj_jk; gc(FALSE)
          
        }
        
      predict_BI_obj[[j]] <- predict_BI_obj_j; gc(FALSE)
              
    }
    
    sensitivity_BI_obj[[i]] <- predict_BI_obj
    
  }
  
  attr(sensitivity_BI_obj, 'tested_values') <- param_values
  return(sensitivity_BI_obj)

}<commit_msg>remove rescaling in sensitivity analysis to prevent overflow<commit_after>sensitivity_BI <- function(dir, newdata, manage, param, n, verbose=FALSE) {
  
  sensitivity_BI_obj <- vector('list', n); gc(FALSE)
  param_values <- seq(
    min(newdata[[manage]][, param]), 
    max(newdata[[manage]][, param]), 
    length=n)
  
  for (i in seq_len(n)) {
    
    inputs <- newdata
    inputs[[manage]][, param] <- param_values[i]
      
    predict_BI_obj <- vector('list', 3); gc(FALSE)
    names(predict_BI_obj) <- c('LDW', 'HDW', 'MAT')
      
    for (j in names(predict_BI_obj)) {
        
      predict_BI_obj_j <- vector('list', 15); gc(FALSE)
        
      for (k in seq_along(predict_BI_obj_j) ) {
          
        predict_BI_obj_jk <- vector('list', 2); gc(FALSE)
          
        if(verbose) cat('Prediction: ')
          
        load(sprintf('%s/%s_%s_%s.rda', dir, manage, j, k))
          
        predict_BI_obj_jk[[1]] <- plogis(predict(earth_BI_obj_ijk[[1]], 
          inputs[[manage]])); gc(FALSE)
          
        if(verbose) cat(sprintf('%s %s %s %s %s \n', param, i, manage, j, k))
          
        predict_BI_obj_jk[[2]] <- sapply(seq_along(earth_BI_obj_ijk[[2]]), function(REP) {
          plogis(predict(earth_BI_obj_ijk[[2]][[REP]], 
            inputs[[manage]]))}); gc(FALSE)
          
        rm(earth_BI_obj_ijk)
          
        predict_BI_obj_j[[k]] <- predict_BI_obj_jk; gc(FALSE)
          
        }
        
      predict_BI_obj[[j]] <- predict_BI_obj_j; gc(FALSE)
              
    }
    
    sensitivity_BI_obj[[i]] <- predict_BI_obj
    
  }
  
  attr(sensitivity_BI_obj, 'tested_values') <- param_values
  return(sensitivity_BI_obj)

}
{'fraction_non_alphanumeric': 0.1615499254843517, 'fraction_numerical': 0.00894187779433681, 'mean_word_length': 2.316205533596838, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '720792', 'n_tokens_mistral': 1304, 'n_tokens_neox': 1225, 'n_words': 197}