frankkramer-lab / aucmedi

a framework for Automated Classification of Medical Images
https://frankkramer-lab.github.io/aucmedi/
GNU General Public License v3.0
38 stars 12 forks source link

fix: classes parameter (change np.array) #216

Closed 3410-Sassy closed 6 months ago

3410-Sassy commented 7 months ago

Environment

Traceback

Traceback (most recent call last):
  File "~/.../script.py", line 154, in <module>
    weights = compute_multilabel_weights(ohe_array=y_train)
  File "~/anaconda3/envs/ailab/lib/python3.10/site-packages/aucmedi/utils/class_weights.py", line 103, in compute_multilabel_weights
    weight = compute_class_weight(class_weight=method, classes=[0,1],
  File "~/anaconda3/envs/ailab/lib/python3.10/site-packages/sklearn/utils/_param_validation.py", line 203, in wrapper
    validate_parameter_constraints(
  File "~/anaconda3/envs/ailab/lib/python3.10/site-packages/sklearn/utils/_param_validation.py", line 95, in validate_parameter_constraints
    raise InvalidParameterError(
sklearn.utils._param_validation.InvalidParameterError: The 'classes' parameter of compute_class_weight must be an instance of 'numpy.ndarray'. Got [0, 1] instead.

Fix

muellerdo commented 6 months ago

Hello @Sassy-Nazogram,

thank you very much for your contribution and your interest in AUCMEDI!

Really appreciated & helpful!

If you need any help with a project or advice, feel free to get in contact.

Best Regards, Dominik