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

Fixed small bug in performance_metrics/forecasting/_functions.py #422

Merged
merged 3 commits into from Oct 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions sktime/performance_metrics/forecasting/_functions.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python3 -u
# coding: utf-8
# -*- coding: utf-8 -*-
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)

import numpy as np
Expand Down Expand Up @@ -53,9 +53,11 @@ def mase_loss(y_test, y_pred, y_train, sp=1):
# check if training set is prior to test set
if y_train is not None:
check_time_index(y_train.index)
if y_train.index.max() >= y_test.min():
raise ValueError("Found `y_train` with time index which is not "
"before time index of `y_pred`")
if y_train.index.max() >= y_test.index.min():
raise ValueError(
"Found `y_train` with time index which is not "
"before time index of `y_test`"
)

#  naive seasonal prediction
y_train = np.asarray(y_train)
Expand Down