Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
#results_ss = fci.random_forest_error(new_forest, X_train, X_test,
# calibrate=False,
# memory_constrained=memory_constrained,
# memory_limit=memory_limit)
results_ss = random_forest_error_modified(new_forest, is_ensemble, X_train, X_test,
calibrate=False,
memory_constrained=memory_constrained,
memory_limit=memory_limit)
# Use this second set of variance estimates
# to estimate scale of Monte Carlo noise
sigma2_ss = np.mean((results_ss - V_IJ_unbiased)**2)
delta = n_sample / n_trees
sigma2 = (delta**2 + (1 - delta)**2) / (2 * (1 - delta)**2) * sigma2_ss
# Use Monte Carlo noise scale estimate for empirical Bayes calibration
V_IJ_calibrated = fci.calibration.calibrateEB(V_IJ_unbiased, sigma2)
return V_IJ_calibrated