def __init__(self, data, param, settings, cache, cache_tmp): self.trees = [] self.pmcmc_objects = [] self.pred_val_mat_train = np.zeros((data['n_train'], settings.m_bart)) self.update_pred_val_sum() # updates pred_val_sum_train for i_t in range(settings.m_bart): p, pred_tmp, pmcmc = init_tree_mcmc(data, settings, param, cache, cache_tmp) sample_param(p, settings, param, False) #NOTE: deterministic initialization if True self.trees.append(p) self.pmcmc_objects.append(pmcmc) self.update_pred_val(i_t, data, param, settings) self.lambda_logprior = compute_gamma_loglik(param.lambda_bart, param.alpha_bart, param.beta_bart)
def __init__(self,data,param,settings,cache,cache_tmp): self.trees =[] self.pmcmc_objects=[] self.predicted_value_mat_train = np.zeros((data['n_train'],settings.m_bart)) self.update_predicted_value_sum() for ele in range(settings.m_bart): p,predicted_tmp,pmcmc = init_tree_mcmc(data,settings,param,cache,cache_tmp) sample_param(p,settings,param,False) self.trees.append(p) self.pmcmc_objects.append(pmcmc) self.update_predicted_value(ele,data,param,settings) self.lambda_logprior = compute_gamma_loglik(param.lambda_bart,param.alpha_bart,param.beta_bart)