diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e4ed2db..ba35eb97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - `pycmError` class ### Changed - `__trapezoidal_numeric_integral__` function updated +- `_set_to_multihot` function updated - Curve validation modified - Internal functions renamed - `README.md` modified diff --git a/pycm/multilabel_cm.py b/pycm/multilabel_cm.py index c0dae905..1efd2733 100644 --- a/pycm/multilabel_cm.py +++ b/pycm/multilabel_cm.py @@ -174,8 +174,4 @@ def _set_to_multihot(input_set: Set[Any], classes: List[Any]) -> List[int]: :param input_set: input set :param classes: ordered labels of classes """ - result = [0] * len(classes) - for i, x in enumerate(classes): - if x in input_set: - result[i] = 1 - return result + return [int(x in input_set) for x in classes]