Skip to content

Commit

Permalink
Automated autopep8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autopep8 bot committed Feb 14, 2025
1 parent a8d283a commit 683eafc
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 23 deletions.
16 changes: 8 additions & 8 deletions fedot_ind/api/utils/checkers_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,16 @@ def encode_idx(dict_with_target): return Either(value=dict_with_target,
def define_horizon(dict_with_idx): return Either(value=dict_with_idx,
monoid=[dict_with_idx, self.strategy_params is None]).either(
left_function=lambda dict: dict | {'have_predict_horizon':
all([self.strategy_params['data_type'] == 'time_series',
'detection_window' in self.strategy_params.keys()])},
all([self.strategy_params['data_type'] == 'time_series',
'detection_window' in self.strategy_params.keys()])},
right_function=lambda dict: dict | {'have_predict_horizon': False})

def define_task(dict_with_horizon): return Either(value=dict_with_horizon,
monoid=[dict_with_horizon,
dict_with_horizon['have_predict_horizon']]).either(
right_function=lambda dict: dict |
{'task': fedot_task('ts_forecasting',
self.strategy_params['detection_window'])},
{'task': fedot_task('ts_forecasting',
self.strategy_params['detection_window'])},
left_function=lambda dict: dict | {'task': fedot_task(self.task)})

encoded_dict = Either.insert(data_dict). \
Expand Down Expand Up @@ -179,7 +179,7 @@ def _check_input_data_features(self):
then(lambda data: np.where(np.isnan(data), 0, data)). \
then(lambda data_without_nan: np.where(np.isinf(data_without_nan), 0, data_without_nan)). \
then(lambda data_without_inf: NumpyConverter(data=data_without_inf).convert_to_torch_format()
if self.task != 'ts_forecasting' else data_without_inf).value
if self.task != 'ts_forecasting' else data_without_inf).value

def _check_input_data_target(self):
"""Checks and preprocesses the features in the input data.
Expand Down Expand Up @@ -216,9 +216,9 @@ def _convert_ts2tabular(self, input_data, sampling_strategy):
channel_start, channel_end = list(sampling_strategy['channels'].values())
element_start, element_end = list(sampling_strategy['elements'].values())
input_data.features = self.input_data.features[
sample_start:sample_end,
channel_start:channel_end,
element_start:element_end]
sample_start:sample_end,
channel_start:channel_end,
element_start:element_end]
fg_list = self.strategy_params['feature_generator']
ts2tabular_model = TabularExtractor({'feature_domain': fg_list,
'reduce_dimension': False})
Expand Down
43 changes: 28 additions & 15 deletions fedot_ind/core/repository/config_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class AutomlLearningConfigConstant(Enum):
class AutomlConfigConstant(Enum):
DEFAULT_SUBCONFIG = {'use_automl': True,
'optimisation_strategy': {'optimisation_strategy':
{'mutation_agent': 'random',
'mutation_strategy': 'growth_mutation_strategy'},
{'mutation_agent': 'random',
'mutation_strategy': 'growth_mutation_strategy'},
'optimisation_agent': 'Industrial'}}
DEFAULT_CLF_AUTOML_CONFIG = {'task': 'classification', **DEFAULT_SUBCONFIG}
DEFAULT_REG_AUTOML_CONFIG = {'task': 'regression', **DEFAULT_SUBCONFIG}
Expand All @@ -41,19 +41,32 @@ class LearningConfigConstant(Enum):
DEFAULT_REG_LEARNING_CONFIG = {'optimisation_loss': {'quality_loss': 'rmse'}, **DEFAULT_SUBCONFIG}
DEFAULT_TSF_LEARNING_CONFIG = {'optimisation_loss': {'quality_loss': 'rmse'}, **DEFAULT_SUBCONFIG}
TASK_MAPPING = {
'classification': {'task': 'classification', 'use_automl': True,
'optimisation_strategy': {'optimisation_strategy': {'mutation_agent': 'random',
'mutation_strategy': 'growth_mutation_strategy'},
'optimisation_agent': 'Industrial'}},
'regression': {'task': 'regression', 'use_automl': True,
'optimisation_strategy': {'optimisation_strategy': {'mutation_agent': 'random',
'mutation_strategy': 'growth_mutation_strategy'},
'optimisation_agent': 'Industrial'}},
'ts_forecasting': {'task': 'ts_forecasting', 'use_automl': True, 'task_params': {'forecast_length': 14},
'optimisation_strategy': {'optimisation_strategy': {'mutation_agent': 'random',
'mutation_strategy': 'growth_mutation_strategy'},
'optimisation_agent': 'Industrial'}}
}
'classification': {
'task': 'classification',
'use_automl': True,
'optimisation_strategy': {
'optimisation_strategy': {
'mutation_agent': 'random',
'mutation_strategy': 'growth_mutation_strategy'},
'optimisation_agent': 'Industrial'}},
'regression': {
'task': 'regression',
'use_automl': True,
'optimisation_strategy': {
'optimisation_strategy': {
'mutation_agent': 'random',
'mutation_strategy': 'growth_mutation_strategy'},
'optimisation_agent': 'Industrial'}},
'ts_forecasting': {
'task': 'ts_forecasting',
'use_automl': True,
'task_params': {
'forecast_length': 14},
'optimisation_strategy': {
'optimisation_strategy': {
'mutation_agent': 'random',
'mutation_strategy': 'growth_mutation_strategy'},
'optimisation_agent': 'Industrial'}}}


class IndustrialConfigConstant(Enum):
Expand Down

0 comments on commit 683eafc

Please # to comment.