mirror of
https://github.com/Doctorado-ML/bayesclass.git
synced 2025-08-16 16:15:57 +00:00
Fix KDB algorithm error
This commit is contained in:
@@ -293,14 +293,15 @@ class KDB(BayesBase):
|
|||||||
num = 0
|
num = 0
|
||||||
while not exit_cond:
|
while not exit_cond:
|
||||||
max_minfo = np.argmax(cond_w[idx, :])
|
max_minfo = np.argmax(cond_w[idx, :])
|
||||||
try:
|
if max_minfo in S_nodes:
|
||||||
dag.add_edge(
|
try:
|
||||||
self.features_[max_minfo], self.features_[idx]
|
dag.add_edge(
|
||||||
)
|
self.features_[max_minfo], self.features_[idx]
|
||||||
num += 1
|
)
|
||||||
except ValueError:
|
num += 1
|
||||||
# Loops are not allowed
|
except ValueError:
|
||||||
pass
|
# Loops are not allowed
|
||||||
|
pass
|
||||||
cond_w[idx, max_minfo] = -1
|
cond_w[idx, max_minfo] = -1
|
||||||
exit_cond = num == n_edges or np.all(cond_w[idx, :] <= 0)
|
exit_cond = num == n_edges or np.all(cond_w[idx, :] <= 0)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user