Skip to content

Commit

Permalink
Preprocessing fix for binary classification
Browse files Browse the repository at this point in the history
  • Loading branch information
staeros committed Nov 13, 2023
1 parent a5a9dd3 commit c0055f9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nas/data/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import cv2
import numpy as np
from fedot.core.data.data import InputData
from sklearn.preprocessing import OneHotEncoder
from sklearn.preprocessing import OneHotEncoder, LabelEncoder


class BaseDataLoader(ABC):
Expand All @@ -25,7 +25,9 @@ def target(self):

if self.dataset.num_classes > 2:
encoder = OneHotEncoder(handle_unknown='error', dtype=int, sparse_output=False)
new_targets = encoder.fit_transform(new_targets)
else:
encoder = LabelEncoder()
new_targets = encoder.fit_transform(new_targets)
return new_targets

@abstractmethod
Expand Down

0 comments on commit c0055f9

Please sign in to comment.