Skip to content

Commit

Permalink
Micro patch 0.4.1.2 (#126)
Browse files Browse the repository at this point in the history
* small fixes for 1 sample prediction cases. Excluded IOPT tuner
* patch version
---------

Co-authored-by: v1docq <[email protected]>
Co-authored-by: technocreep <[email protected]>
  • Loading branch information
3 people authored Mar 7, 2024
1 parent c53e963 commit 4b271c1
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
10 changes: 6 additions & 4 deletions fedot_ind/api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,12 @@ def load(self, path):
"""
self.repo = IndustrialModels().setup_repository()

dir_list = os.listdir(path)
p = [x for x in dir_list if x.__contains__('pipeline_saved')][0]
path = f'{path}/{p}'
if not path.__contains__('pipeline_saved'):
dir_list = os.listdir(path)
p = [x for x in dir_list if x.__contains__('pipeline_saved')][0]
path = f'{path}/{p}'
dir_list = os.listdir(path)

if 'fitted_operations' in dir_list:
self.solver = Pipeline().load(path)
else:
Expand All @@ -395,6 +396,7 @@ def save_best_model(self):
for idx, p in enumerate(self.solver.ensemble_branches):
Pipeline(p).save(f'./raf_ensemble/{idx}_ensemble_branch', create_subdir=True)
Pipeline(self.solver.ensemble_head).save(f'./raf_ensemble/ensemble_head', create_subdir=True)
self.solver.current_pipeline.save(f'./raf_ensemble/ensemble_composed', create_subdir=True)

def plot_fitness_by_generation(self, **kwargs):
"""Plot prediction of the model"""
Expand Down
6 changes: 4 additions & 2 deletions fedot_ind/core/architecture/preprocessing/data_convertor.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,10 @@ def output_mode_converter(self, output_mode, n_classes):
return self.probs_prediction_converter(output_mode, n_classes)

def probs_prediction_converter(self, output_mode, n_classes):
prediction = self.operation_implementation.predict_proba(
self.train_data.features)
try:
prediction = self.operation_implementation.predict_proba(self.train_data.features)
except Exception:
prediction = self.operation_implementation.predict_proba(self.train_data.features.T)
if n_classes < 2:
raise ValueError(
'Data set contain only 1 target class. Please reformat your data.')
Expand Down
5 changes: 4 additions & 1 deletion fedot_ind/core/operation/transformation/basis/eigen_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,11 @@ def _channel_decompose(self, features):
return predict

def _convert_basis_to_predict(self, basis, input_data):
self.predict = basis

if input_data.features.shape[0] == 1 and len(input_data.features.shape) == 3:
self.predict = basis[np.newaxis, :, :]
else:
self.predict = basis
if input_data.task.task_params is None:
input_data.task.task_params = self.__repr__()
elif input_data.task.task_params not in [self.__repr__(), 'LargeFeatureSpace']:
Expand Down
2 changes: 1 addition & 1 deletion fedot_ind/core/repository/constanst_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class FedotOperationConstant(Enum):
'regression': RegressionMetricsEnum.RMSE}
FEDOT_TUNER_STRATEGY = {'sequential': partial(SequentialTuner, inverse_node_order=True),
'simultaneous': SimultaneousTuner,
'IOptTuner': IOptTuner,
# 'IOptTuner': IOptTuner,
'optuna': OptunaTuner}
FEDOT_HEAD_ENSEMBLE = {'regression': 'treg',
'classification': 'logit'}
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# The text of the README file
NAME = 'fedot_ind'
VERSION = '0.4.1'
VERSION = '0.4.1.2'
AUTHOR = 'NSS Lab'
AUTHOR_EMAIL = '[email protected]'
SHORT_DESCRIPTION = 'Automated machine learning framework for time series analysis'
Expand Down

0 comments on commit 4b271c1

Please sign in to comment.