Commit 91728d56 authored by Marta Różańska's avatar Marta Różańska
Browse files

Merge branch 'tft_nbeats' into 'morphemic-rc1.5'

errors while committing removed

See merge request !166
parents dda3e686 2917f161
Pipeline #16404 passed with stages
in 28 minutes and 5 seconds
......@@ -108,11 +108,11 @@ def main():
)
# msg1 = Msg()
# msg1.body = '[{"metric": "MinimumCores", "level": 3, "publish_rate": 30000}, {"metric": "metric_0", "level": 3, "publish_rate": 30000}, {"metric": "metric_1", "level": 3, "publish_rate": 30000}]'
# msg1.body = '[{"metric": "MinimumCores", "level": 3, "publish_rate": 30000}, {"metric": "EstimatedRemainingTimeContext", "level": 3, "publish_rate": 30000}, {"metric": "NotFinishedOnTimeContext", "level": 3, "publish_rate": 30000}]'
# msg2 = Msg()
# msg2.body = (
# "{"
# + f'"metrics": ["MinimumCores", "metric_0", "metric_1"],"timestamp": {int(time.time())}, "epoch_start": {int(time.time()) + 30}, "number_of_forward_predictions": 8,"prediction_horizon": 60'
# + f'"metrics": ["MinimumCores", "EstimatedRemainingTimeContext", "NotFinishedOnTimeContext"],"timestamp": {int(time.time())}, "epoch_start": {int(time.time()) + 30}, "number_of_forward_predictions": 8,"prediction_horizon": 30'
# + "}"
# )
......
......@@ -42,8 +42,9 @@ class Dataset(object):
def cut_nan_start(self, dataset):
dataset.index = range(dataset.shape[0])
first_not_nan_index = dataset[self.target_column].first_valid_index()
if first_not_nan_index > -1:
return dataset[dataset.index > first_not_nan_index]
if first_not_nan_index == first_not_nan_index: # check is if it;s not np.nan
if first_not_nan_index > -1:
return dataset[dataset.index > first_not_nan_index]
else:
return dataset.dropna()
......
......@@ -46,7 +46,7 @@ class Dataset(object):
def cut_nan_start(self, dataset):
dataset.index = range(dataset.shape[0])
first_not_nan_index = dataset[self.target_column].first_valid_index()
if first_not_nan_index:
if first_not_nan_index == first_not_nan_index: # check is if it;s not np.nan
if first_not_nan_index > -1:
return dataset[dataset.index > first_not_nan_index]
else:
......@@ -115,6 +115,7 @@ class Dataset(object):
).fillna(np.nan)
self.dataset = self.dataset.replace(np.inf, np.nan)
self.dataset = self.dataset.dropna(subset=[self.target_column])
print(self.dataset)
if self.dataset.shape[0] > 0:
max_gap = self.dataset["time"].diff().abs().max()
logging.info(
......
......@@ -114,11 +114,11 @@ def main():
)
# msg1 = Msg()
# msg1.body = '[{"metric": "MinimumCores", "level": 3, "publish_rate": 30000}, {"metric": "metric_0", "level": 3, "publish_rate": 30000}, {"metric": "metric_1", "level": 3, "publish_rate": 30000}]'
# msg1.body = '[{"metric": "MinimumCores", "level": 3, "publish_rate": 30000}, {"metric": "EstimatedRemainingTimeContext", "level": 3, "publish_rate": 30000}, {"metric": "NotFinishedOnTimeContext", "level": 3, "publish_rate": 30000}]'
# msg2 = Msg()
# msg2.body = (
# "{"
# + f'"metrics": ["MinimumCores", "metric_0", "metric_1"],"timestamp": {int(time.time())}, "epoch_start": {int(time.time()) + 30}, "number_of_forward_predictions": 8,"prediction_horizon": 30'
# + f'"metrics": ["MinimumCores", "EstimatedRemainingTimeContext", "NotFinishedOnTimeContext"],"timestamp": {int(time.time())}, "epoch_start": {int(time.time()) + 30}, "number_of_forward_predictions": 8,"prediction_horizon": 30'
# + "}"
# )
......
......@@ -46,8 +46,9 @@ class Dataset(object):
def cut_nan_start(self, dataset):
dataset.index = range(dataset.shape[0])
first_not_nan_index = dataset[self.target_column].first_valid_index()
if first_not_nan_index > -1:
return dataset[dataset.index > first_not_nan_index]
if first_not_nan_index == first_not_nan_index: # check is if it;s not np.nan
if first_not_nan_index > -1:
return dataset[dataset.index > first_not_nan_index]
else:
return dataset.dropna()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment