Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
fixed probabilites operation between levels of classifier
Browse files Browse the repository at this point in the history
  • Loading branch information
JavierArredondo committed Jul 23, 2021
1 parent bac74c0 commit 4cca0ee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lc_classifier/classifier/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,13 @@ def predict_in_pipeline(self, input_features: pd.DataFrame) -> dict:

prob_children = []
resp_children = {}

child_models = [
self.stochastic_classifier,
self.periodic_classifier,
self.transient_classifier,
self.periodic_classifier,
]
child_names = ["Stochastic", "Periodic", "Transient"]
child_names = ["Transient", "Stochastic", "Periodic"]

for name, model in zip(child_names, child_models):
prob_child = pd.DataFrame(
model.predict_proba(input_features),
Expand All @@ -312,7 +312,7 @@ def predict_in_pipeline(self, input_features: pd.DataFrame) -> dict:
)

resp_children[name] = prob_child
prob_child = prob_child.mul(prob_root[name].values, axis="rows")
prob_child = prob_child.mul(prob_root[name].values, axis=0)
prob_children.append(prob_child)
prob_all = pd.concat(prob_children, axis=1, sort=False)

Expand Down

0 comments on commit 4cca0ee

Please sign in to comment.