Commit 2f0da411 authored by maciek riedl's avatar maciek riedl
Browse files

Merge branch 'exponential_smoothing_predictor' into 'morphemic-rc2.0'

Corrections necessary for the appropriate operation of the exponential smoothing predictor

See merge request !280
parents 323213ae 5e73ffe8
Pipeline #20537 passed with stages
in 31 minutes and 48 seconds
......@@ -86,8 +86,11 @@ data_to_process <- data_to_process[data_to_process[[time_field_name]]>oldest_acc
#Fail-safe default
df1 <- xts(as.numeric(data_to_process[,attribute_to_predict]),anytime(data_to_process[,time_field_name]))
date_time_init <- anytime(data_to_process[,time_field_name])
date_time_complete <- seq.POSIXt(from=min(date_time_init),
to=max(date_time_init),by=time_unit_granularity)
date_time_complete <- seq.POSIXt(
from=as.POSIXct(min(date_time_init),origin = "1970-01-01"),
to=as.POSIXct(max(date_time_init),origin = "1970-01-01"),
by=time_unit_granularity
)
df2 <- merge(df1,xts(,date_time_complete))
mydata <- na.approx(df2)
colnames(mydata)<-c(attribute_to_predict)
......
......@@ -147,7 +147,7 @@ def calculate_and_publish_predictions(prediction_horizon,maximum_time_required_f
try:
prediction = predict_attributes(State.metrics_to_predict,State.next_prediction_time)
except Exception as e:
print_with_time("Could not create a prediction for some or all of the metrics for time point "+State.next_prediction_time+", proceeding to next prediction time. The encountered exception trace follows:")
print_with_time("Could not create a prediction for some or all of the metrics for time point "+str(State.next_prediction_time)+", proceeding to next prediction time. The encountered exception trace follows:")
print(e)
continue
for attribute in State.metrics_to_predict:
......
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