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 Jan 16, 2025
1 parent 10e87b9 commit 5fba668
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
10 changes: 5 additions & 5 deletions fedot_ind/api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ def __init_solver(self, input_data):
metric=self.manager.learning_config.config['optimisation_loss'],
problem=self.manager.automl_config.config['task'],
task_params=self.manager.industrial_config.task_params
if self.manager.industrial_config.is_forecasting_context else self.manager.automl_config.config['task_params'],
optimizer=self.manager.automl_config.optimisation_strategy,
if self.manager.industrial_config.is_forecasting_context else self.manager.automl_config.config
['task_params'], optimizer=self.manager.automl_config.optimisation_strategy,
available_operations=self.manager.automl_config.config['available_operations'],
initial_assumption=self.manager.automl_config.config['initial_assumption'])
return input_data
Expand Down Expand Up @@ -245,8 +245,8 @@ def fit(self,
def fit_function(train_data): return \
Either(value=train_data, monoid=[train_data,
not isinstance(self.manager.industrial_config.strategy, Callable)]). \
either(left_function=lambda data: self.manager.industrial_config.strategy.fit(data),
right_function=lambda data: self.manager.solver.fit(data))
either(left_function=lambda data: self.manager.industrial_config.strategy.fit(data),
right_function=lambda data: self.manager.solver.fit(data))

Either.insert(self._process_input_data(input_data)). \
then(lambda data: self.__init_industrial_backend(data)). \
Expand Down Expand Up @@ -367,7 +367,7 @@ def get_metrics(self,
predicted_probs=probs,
rounding_order=rounding_order,
metric_names=metric_names) for strategy,
probs in self.predicted_probs.items()}
probs in self.predicted_probs.items()}

else:
metric_dict = self._metric_evaluation_loop(
Expand Down
2 changes: 1 addition & 1 deletion fedot_ind/api/utils/api_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def __init__(self):
'learning_config': self.with_learning_config,
'compute_config': self.with_compute_config}
self.optimisation_agent = {"Industrial": IndustrialEvoOptimizer,
'Fedot': FedotEvoOptimizer}
'Fedot': FedotEvoOptimizer}

def null_state_object(self):
self.solver = None
Expand Down
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 @@ -116,16 +116,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 @@ -177,7 +177,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 @@ -215,9 +215,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
1 change: 0 additions & 1 deletion fedot_ind/core/repository/constanst_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ class FedotOperationConstant(Enum):
'lora_strategy',
'sampling_strategy']


FEDOT_ENSEMBLE_ASSUMPTIONS = {
'classification': PipelineBuilder().add_node('logit'),
'regression': PipelineBuilder().add_node('treg')
Expand Down

0 comments on commit 5fba668

Please sign in to comment.