Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

628 bugfix #1145

Merged
merged 4 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cases/multi_target_levels_forecasting.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from fedot.api.main import Fedot
from fedot.core.data.data import InputData
from fedot.core.data.data_split import train_test_data_setup
from fedot.core.utils import fedot_project_root

warnings.filterwarnings('ignore')

Expand Down Expand Up @@ -99,5 +100,5 @@ def run_multi_output_case(path, vis=False):


if __name__ == '__main__':
path_file = './data/lena_levels/multi_sample.csv'
path_file = fedot_project_root() / 'cases/data/lena_levels/multi_sample.csv'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В первый раз вижу такую запись пути. Обычно использовали Path.path для этого

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fedot_project_root() возвращает pathlib.Path. К нему таким образом можно присоединять пути.

А что за Path.path?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fedot_project_root() возвращает pathlib.Path. К нему таким образом можно присоединять пути.

А что за Path.path?

Перепутал с pathlib.Path

run_multi_output_case(path_file, vis=True)
2 changes: 0 additions & 2 deletions cases/multi_ts_level_forecasting.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os

import numpy as np
from matplotlib import pyplot as plt
from sklearn.metrics import mean_absolute_error, mean_squared_error, mean_absolute_percentage_error

from examples.simple.time_series_forecasting.ts_pipelines import ts_complex_ridge_smoothing_pipeline
Expand Down Expand Up @@ -52,7 +51,6 @@ def run_multi_ts_forecast(forecast_length, is_multi_ts):
pop_size=15,
max_arity=4,
cv_folds=None,
validation_blocks=None,
initial_assumption=init_pipeline
)
# fit model
Expand Down
9 changes: 7 additions & 2 deletions test/integration/composer/test_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import numpy as np
import pytest

from fedot.core.repository.tasks import TaskTypesEnum
from golem.core.dag.graph import Graph
from golem.core.optimisers.fitness import SingleObjFitness
from golem.core.optimisers.genetic.evaluation import MultiprocessingDispatcher
Expand Down Expand Up @@ -118,8 +120,11 @@ def test_collect_intermediate_metric(pipeline: Pipeline, input_data: InputData,
graph_gen_params = get_pipeline_generation_params()
metrics = [metric]

data_source = DataSourceSplitter(validation_blocks=1).build(input_data)
objective_eval = PipelineObjectiveEvaluate(MetricsObjective(metrics), data_source)
validation_blocks = 1 if input_data.task.task_type is TaskTypesEnum.ts_forecasting else None
data_source = DataSourceSplitter(validation_blocks=validation_blocks).build(input_data)
objective_eval = PipelineObjectiveEvaluate(MetricsObjective(metrics),
data_source,
validation_blocks=validation_blocks)
dispatcher = MultiprocessingDispatcher(graph_gen_params.adapter)
dispatcher.set_graph_evaluation_callback(objective_eval.evaluate_intermediate_metrics)
evaluate = dispatcher.dispatch(objective_eval)
Expand Down
Loading