Skip to content

Commit

Permalink
Merge pull request #52 from hmgomes/fix_get_moa_creation_CLI_function
Browse files Browse the repository at this point in the history
Fix get moa creation cli function
  • Loading branch information
hmgomes authored Apr 22, 2024
2 parents 77aacfe + 52c0c49 commit ed2a164
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/capymoa/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,16 @@ def _get_moa_creation_CLI(moa_learner):
"""
moa_learner_class_id = str(moa_learner.getClass().getName())
moa_learner_class_id_parts = moa_learner_class_id.split(".")

# label the category of the moa_learner
moa_learner_category = 0
if isinstance(moa_learner, MOA_Classifier_Interface):
moa_learner_category +=1
if isinstance(moa_learner, MOA_Regressor_Interface):
moa_learner_category +=1

moa_learner_str = (
f"{moa_learner_class_id_parts[-2]}.{moa_learner_class_id_parts[-1]}" if isinstance(moa_learner, MOA_Classifier_Interface)
f"{moa_learner_class_id_parts[-2]}.{moa_learner_class_id_parts[-1]}" if moa_learner_category == 1
else f"{moa_learner_class_id_parts[-1]}"
)

Expand Down

0 comments on commit ed2a164

Please sign in to comment.