Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kasyanovse committed Aug 14, 2023
1 parent e3da922 commit d77ecdb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fedot/core/data/data_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def _are_stratification_allowed(data: Union[InputData, MultiModalData], split_ra
try:
# fast way
classes = np.unique(data.target, return_counts=True)
except:
except Exception:
# slow way
from collections import Counter
classes = Counter(data.target)
Expand Down
6 changes: 3 additions & 3 deletions fedot/core/optimisers/objective/data_source_splitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ def build(self, data: Union[InputData, MultiModalData]) -> DataSource:

# Check cv_folds
if self.cv_folds is not None:
if not isinstance(self.cv_folds, int):
if self.cv_folds % 1 != 0:
raise ValueError(f"cv_folds is not integer: {self.cv_folds}")
try:
self.cv_folds = int(self.cv_folds)
except ValueError:
raise ValueError(f"cv_folds is not integer: {self.cv_folds}")
if self.cv_folds < 2:
self.cv_folds = None
if self.cv_folds > data.target.shape[0] - 1:
Expand Down
2 changes: 1 addition & 1 deletion test/integration/api/test_api_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_output_binary_classification_correct():
task_type = 'classification'

data = get_binary_classification_data()

train_data, test_data = train_test_data_setup(data, shuffle=True)

model = Fedot(problem=task_type, seed=1, timeout=0.1)
Expand Down
1 change: 0 additions & 1 deletion test/unit/validation/test_table_cv.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import pytest

from golem.core.tuning.simultaneous import SimultaneousTuner
from sklearn.metrics import roc_auc_score as roc_auc

from fedot.api.main import Fedot
from fedot.core.data.data import InputData
Expand Down

0 comments on commit d77ecdb

Please sign in to comment.