-
Notifications
You must be signed in to change notification settings - Fork 88
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
Fix some bugs #1174
Fix some bugs #1174
Changes from all commits
338a752
cf29ea8
e5449f8
4291999
6582449
7130416
3c88b75
f71b690
98ecba7
d5134cf
98c91fb
f089654
980d038
b4beec9
3eb740a
97b4977
ba4c6d7
94f8e12
b8a15fb
3ee5425
f6a0d41
2665e76
7bfd1eb
a7db620
212620e
131f05a
f92cbfa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -217,11 +217,11 @@ def _fill_first_and_last_gaps(self, input_data: np.array, output_data: np.array) | |
non_nan = output_data[non_nan_ids] | ||
if np.isclose(input_data[0], self.gap_value): | ||
# First element is a gap - replace with first known value | ||
self.log.info(f'First element in the array were replaced by first known value') | ||
self.log.info('First element in the array were replaced by first known value') | ||
output_data[0] = non_nan[0] | ||
if np.isclose(input_data[-1], self.gap_value): | ||
# Last element is a gap - last known value | ||
self.log.info(f'Last element in the array were replaced by last known value') | ||
self.log.info('Last element in the array were replaced by last known value') | ||
output_data[-1] = non_nan[-1] | ||
|
||
return output_data | ||
|
@@ -430,6 +430,13 @@ def __pipeline_fit_predict(self, pipeline, timeseries_train: np.array, len_gap: | |
task=task, | ||
data_type=DataTypesEnum.ts) | ||
|
||
forecast_length = input_data.task.task_params.forecast_length | ||
data_length = input_data.features.shape[0] | ||
for node in pipeline_for_forecast.nodes: | ||
if node.name == 'lagged': | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Мне кажется, что это должно учитываться где-то внутри. Случайный пользователь не додумается до такого There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Так это и есть внутри. Разве нет? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Сейчас получается так, что, если у lagged преобразования длина окна слишком большая для конкретного ряда, то вываливается ошибка, которая нигде не обрабатывается. Это код только для замены пропусков, длина окна будет подбираться только для этой задачи, а в общем случае будет ошибка. То есть придется в любой код, в котором мы не хотим, чтобы вываливалась ошибка, писать подобные условия There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Все правильно, разве нет? |
||
if node.parameters['window_size'] + forecast_length >= data_length: | ||
node.parameters = {'window_size': data_length - forecast_length - 1} | ||
valer1435 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# Making predictions for the missing part in the time series | ||
pipeline_for_forecast.fit_from_scratch(input_data) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Что предполагается делать в случае, когда длина окна больше допустимой для конкретного ряда?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Кидать ошибку. Это некорректный случай.
Идея в том, чтобы убрать скрытое поведение. Если тюнер или композер хотят поставить некорректное значение окна, то пусть они узнают об этом.