Skip to content

Commit

Permalink
Fix bug with test_default_forecast (add new TODO for ts_forecasting)
Browse files Browse the repository at this point in the history
  • Loading branch information
aPovidlo committed Aug 15, 2024
1 parent 3134fc6 commit e5db54d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions fedot/core/data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ def get_not_encoded_data(self):
num_features_names, cat_features_names = None, None

# Checking numerical data exists
if self.numerical_idx:
if self.numerical_idx.any():
num_features = self.features[:, self.numerical_idx]

if self.features_names is not None and np.size(self.features_names):
Expand All @@ -622,7 +622,7 @@ def get_not_encoded_data(self):
num_features_names = np.array([f'num_feature_{i}' for i in range(1, num_features.shape[1] + 1)])

# Checking categorical data exists
if self.categorical_idx:
if self.categorical_idx.any():
cat_features = self.categorical_features

if self.features_names is not None and np.size(self.features_names):
Expand Down
13 changes: 9 additions & 4 deletions fedot/preprocessing/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,11 +595,16 @@ def reduce_mem_usage_np(arr, initial_types):
return reduced_columns

if isinstance(data, InputData):
self.log.message('-- Reduce memory in features')
data.features = reduce_mem_usage_np(data.features, data.supplementary_data.col_type_ids['features'])
if data.task.task_type == TaskTypesEnum.ts_forecasting:
# TODO: TS data has col_type_ids['features'] = None.
# It required to add this to reduce memory for them
pass
else:
self.log.message('-- Reduce memory in features')
data.features = reduce_mem_usage_np(data.features, data.supplementary_data.col_type_ids['features'])

self.log.message('-- Reduce memory in target')
data.target = reduce_mem_usage_np(data.target, data.supplementary_data.col_type_ids['target'])
self.log.message('-- Reduce memory in target')
data.target = reduce_mem_usage_np(data.target, data.supplementary_data.col_type_ids['target'])

return data

Expand Down

0 comments on commit e5db54d

Please sign in to comment.