Skip to content

Commit

Permalink
Fix api_forecasting example
Browse files Browse the repository at this point in the history
  • Loading branch information
YamLyubov committed Nov 11, 2022
1 parent 9654de0 commit 3e77e87
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions examples/simple/time_series_forecasting/api_forecasting.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def run_ts_forecasting_example(dataset='australia', horizon: int = 30, validatio
target=time_series,
task=task,
data_type=DataTypesEnum.ts)
train_data, test_data = train_test_data_setup(train_input, validation_blocks=validation_blocks)
train_data, test_data = train_test_data_setup(train_input)

# init model for the time series forecasting
model = Fedot(problem='ts_forecasting',
Expand All @@ -50,8 +50,7 @@ def run_ts_forecasting_example(dataset='australia', horizon: int = 30, validatio

# use model to obtain forecast
forecast = model.predict(test_data)
target = np.ravel(test_data.target)
print(model.get_metrics(metric_names=['rmse', 'mae', 'mape'], target=target))
print(model.get_metrics(metric_names=['rmse', 'mae', 'mape'], target=test_data.target))

# plot forecasting result
if visualization:
Expand Down

0 comments on commit 3e77e87

Please # to comment.