Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/ts_forecasting_advanced' into ts…
Browse files Browse the repository at this point in the history
…_forecasting_advanced
  • Loading branch information
v1docq committed May 17, 2024
2 parents 5001929 + 3bb3246 commit 30bbe4b
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
api_config.update(output_folder=os.path.join(
PROJECT_PATH, 'results_of_experiments', dataset_name))
n_beats_forecast, n_beats_metrics, \
autogluon_forecast, autogluon_metrics = compare_forecast_with_sota(dataset_name=dataset_name,
horizon=horizon)
autogluon_forecast, autogluon_metrics = compare_forecast_with_sota(dataset_name=dataset_name,
horizon=horizon)
model, labels, metrics, target = industrial_forecasting_modelling_loop(dataset_name=dataset_name,
benchmark=benchmark,
horizon=horizon,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
dataset_name = {'benchmark': 'M4',
'dataset': 'D3257'}
finetune = False
initial_assumptions = {'nbeats': PipelineBuilder().add_node('nbeats_model'),
'industiral': PipelineBuilder().add_node(
'eigen_basis',
params={
'low_rank_approximation': False,
'rank_regularization': 'explained_dispersion'}).add_node('ar')}
initial_assumptions = {
'nbeats': PipelineBuilder().add_node('nbeats_model'),
'industiral': PipelineBuilder().add_node(
'eigen_basis',
params={
'low_rank_approximation': False,
'rank_regularization': 'explained_dispersion'}).add_node('ar')}
for assumption in initial_assumptions.keys():
api_config = dict(problem='ts_forecasting',
metric='rmse',
Expand Down
8 changes: 4 additions & 4 deletions fedot_ind/core/metrics/metrics_implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,12 @@ def calculate_classification_metric(
probs,
rounding_order=3,
metric_names=(
'f1',
# 'roc_auc',
'accuracy')):
'f1',
# 'roc_auc',
'accuracy')):
metric_dict = {'accuracy': Accuracy,
'f1': F1,
#'roc_auc': ROCAUC,
# 'roc_auc': ROCAUC,
'precision': Precision,
'logloss': Logloss}

Expand Down
21 changes: 12 additions & 9 deletions fedot_ind/tools/example_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,21 @@ def industrial_common_modelling_loop(
finetune: bool = False,
api_config: dict = None,
metric_names: tuple = (
'r2',
'rmse',
'mae')):
'r2',
'rmse',
'mae')):
industrial = FedotIndustrial(**api_config)
if api_config['problem'] == 'ts_forecasting':
train_data, _ = DataLoader(dataset_name=dataset_name['dataset']).load_forecast_data(
train_data, _ = DataLoader(
dataset_name=dataset_name['dataset']).load_forecast_data(
dataset_name['benchmark'])
target = train_data.values[-api_config['task_params']['forecast_length']:].flatten()
target = train_data.values[-api_config['task_params']
['forecast_length']:].flatten()
train_data = (train_data, target)
test_data = train_data
else:
train_data, test_data = DataLoader(dataset_name=dataset_name).load_data()
train_data, test_data = DataLoader(
dataset_name=dataset_name).load_data()
if finetune:
industrial.finetune(train_data, tuning_params={
'tuning_timeout': api_config['timeout']})
Expand Down Expand Up @@ -139,11 +142,11 @@ def create_comprasion_df(df, metric: str = 'rmse'):
df_full = df_full[df_full['Unnamed: 0'] == metric]
df_full = df_full.drop('Unnamed: 0', axis=1)
df_full['Difference_industrial_All'] = (
df_full.iloc[:, 1:3].min(axis=1) - df_full['industrial'])
df_full.iloc[:, 1:3].min(axis=1) - df_full['industrial'])
df_full['Difference_industrial_AG'] = (
df_full.iloc[:, 1:2].min(axis=1) - df_full['industrial'])
df_full.iloc[:, 1:2].min(axis=1) - df_full['industrial'])
df_full['Difference_industrial_NBEATS'] = (
df_full.iloc[:, 2:3].min(axis=1) - df_full['industrial'])
df_full.iloc[:, 2:3].min(axis=1) - df_full['industrial'])
df_full['industrial_Wins_All'] = df_full.apply(
lambda row: 'Win' if row.loc['Difference_industrial_All'] > 0 else 'Loose', axis=1)
df_full['industrial_Wins_AG'] = df_full.apply(
Expand Down

0 comments on commit 30bbe4b

Please sign in to comment.