Skip to content
Snippets Groups Projects
Commit 29f0ea17 authored by Sören Henning's avatar Sören Henning
Browse files

Correct column indices in lag trend computation

parent d8f32bac
No related branches found
No related tags found
3 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus
Pipeline #2827 canceled
...@@ -4,15 +4,10 @@ import os ...@@ -4,15 +4,10 @@ import os
def compute(data, warmup_sec): def compute(data, warmup_sec):
data['sec_start'] = data.loc[0:, 'timestamp'] - data.iloc[0]['timestamp'] data['sec_start'] = data.loc[0:, 'timestamp'] - data.iloc[0]['timestamp']
print(data)
regress = data.loc[data['sec_start'] >= warmup_sec] # Warm-Up regress = data.loc[data['sec_start'] >= warmup_sec] # Warm-Up
print(regress) X = regress.iloc[:, 1].values.reshape(-1, 1) # values converts it into a numpy array
Y = regress.iloc[:, 2].values.reshape(-1, 1) # -1 means that calculate the dimension of rows, but have 1 column
X = regress.iloc[:, 2].values.reshape(-1, 1) # values converts it into a numpy array
print(X)
Y = regress.iloc[:, 3].values.reshape(-1, 1) # -1 means that calculate the dimension of rows, but have 1 column
print(Y)
linear_regressor = LinearRegression() # create object for the class linear_regressor = LinearRegression() # create object for the class
linear_regressor.fit(X, Y) # perform linear regression linear_regressor.fit(X, Y) # perform linear regression
Y_pred = linear_regressor.predict(X) # make predictions Y_pred = linear_regressor.predict(X) # make predictions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment