Skip to content

Commit

Permalink
data new features bugs fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aPovidlo committed Sep 5, 2023
1 parent 88fa044 commit 6daacc3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion fedot/core/data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,12 @@ def get_not_encoded_data(self):
new_num_idx = np.array([i for i in range(num_features_count)])
new_cat_idx = np.array([i for i in range(num_features_count, num_features_count + cat_features_count)])

num_idx = [idx for idx, _ in enumerate(self.features_names) if not idx in self.categorical_idx]
if self.features_names is not None:
num_idx = [idx for idx, _ in enumerate(self.features_names) if not idx in self.categorical_idx]
else:
self.features_names = [f'feature_{i}' for i in range(1, new_features.shape[1])]
num_idx = [idx for idx, _ in enumerate(self.features_names) if not idx in self.categorical_idx]

num_features_name = self.features_names[num_idx].tolist()
cat_features_name = self.features_names[self.categorical_idx].tolist()

Expand Down
8 changes: 7 additions & 1 deletion fedot/core/data/data_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ def _split_input_data_by_indexes(origin_input_data: Union[InputData, MultiModalD
target=target,
task=deepcopy(origin_input_data.task),
data_type=origin_input_data.data_type,
supplementary_data=origin_input_data.supplementary_data)
supplementary_data=origin_input_data.supplementary_data,
categorical_features=origin_input_data.categorical_features,
categorical_idx=origin_input_data.categorical_idx,
numerical_idx=origin_input_data.numerical_idx,
encoded_idx=origin_input_data.encoded_idx,
features_names=origin_input_data.features_names,
)
return data
else:
raise TypeError(f'Unknown data type {type(origin_input_data)}')
Expand Down

0 comments on commit 6daacc3

Please sign in to comment.