Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
gain -= (p_x_r * np.power(1.0 - p_y_r, self.alpha))
gain = gain / self.alpha / (1.0 - self.alpha)
best_idx = np.argsort(gain)[-1]
return {"selected": avc[best_idx,:]}
def is_leaf(branch, branch_parent):
if (branch["depth"] >= self.max_depth or
branch["n_samples"] < self.min_samples_split):
return True
else:
return False
Bonsai.__init__(self, find_split, is_leaf, z_type="M2")
return ss
def is_leaf(branch, branch_parent):
varsum_dec = 1.0 + self.min_varsum_decrease
if "varsum" in branch_parent:
varsum_dec = branch_parent["varsum"] - branch["varsum"]
if (branch["depth"] >= self.max_depth or
branch["n_samples"] < self.min_samples_split or
varsum_dec < self.min_varsum_decrease):
return True
else:
return False
Bonsai.__init__(self,
find_split,
is_leaf,
subsample = subsample,
random_state = random_state,
n_jobs = n_jobs,
z_type = "M2")
friedman_score = n_l * n_r / (n_l + n_r) * diff2
best_idx = np.argsort(friedman_score)[-1]
ss = {"selected": avc[best_idx,:]}
return ss
def is_leaf(branch, branch_parent):
if (branch["depth"] >= self.max_depth or
branch["n_samples"] < self.min_samples_split):
return True
else:
return False
Bonsai.__init__(self,
find_split,
is_leaf,
subsample=subsample,
random_state=random_state,
n_jobs=n_jobs,
z_type="M2")
ss = {"selected": avc[best_idx,:],
"y@l": y_l[best_idx],
"y@r": y_r[best_idx]}
return ss
def is_leaf(branch, branch_parent):
if (branch["depth"] >= self.max_depth or
branch["n_samples"] < self.min_samples_split):
return True
else:
return False
Bonsai.__init__(self,
find_split,
is_leaf,
subsample=subsample,
random_state=random_state,
n_jobs = n_jobs,
z_type="Hessian")