From e72343e7a3ec5ea481287722fcf0b833eb6bab14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=C3=B4nio=20C=C3=A2ndido=20de=20Lima=20e=20Silva?= Date: Fri, 4 Mar 2022 08:58:30 -0300 Subject: [PATCH] Update trend.py --- pyFTS/common/transformations/trend.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pyFTS/common/transformations/trend.py b/pyFTS/common/transformations/trend.py index df67a46..6384f68 100644 --- a/pyFTS/common/transformations/trend.py +++ b/pyFTS/common/transformations/trend.py @@ -1,4 +1,8 @@ from pyFTS.common.transformations.transformation import Transformation +from pandas import datetime +from sklearn.linear_model import LinearRegression +import numpy as np +import pandas as pd class LinearTrend(Transformation): @@ -24,8 +28,6 @@ class LinearTrend(Transformation): '''Regression model''' def train(self, data, **kwargs): - from pandas import datetime - from sklearn.linear_model import LinearRegression x = data[self.index_field].values @@ -79,4 +81,4 @@ class LinearTrend(Transformation): ret = pd.Series(ret) ret = pd.to_numeric(ret, downcast='integer') - return np.array(ret) \ No newline at end of file + return np.array(ret)