From 27b55b1fde2ab73a66e16c0bf894e02cf6a896bb Mon Sep 17 00:00:00 2001 From: matheus_cascalho Date: Mon, 7 Dec 2020 15:33:35 -0300 Subject: [PATCH] =?UTF-8?q?passagem=20de=20argumentos=20do=20m=C3=A9todo?= =?UTF-8?q?=20train=20pelo=20m=C3=A9todo=20apply?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyFTS/common/transformations/som.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyFTS/common/transformations/som.py b/pyFTS/common/transformations/som.py index 264ad0e..364ae3e 100644 --- a/pyFTS/common/transformations/som.py +++ b/pyFTS/common/transformations/som.py @@ -38,7 +38,7 @@ class SOMTransformation(Transformation): col != endogen_variable] if self.net is None: train = data[cols] - self.train(data=train) + self.train(data=train, **kwargs) new_data = self.net.project(data[cols].values) new_data = pd.DataFrame(new_data, columns=names) endogen = endogen_variable if endogen_variable is not None else data.columns[-1] @@ -88,4 +88,5 @@ if __name__ == '__main__': file = '/home/matheus_cascalho/Documentos/matheus_cascalho/MINDS/TimeSeries_Lab/SOM/Appliance Energy Prediction/energydata_complete.csv' df = pd.read_csv(file, index_col=0) som = SOMTransformation(grid_dimension=(20, 20)) - new_df = som.apply(df.iloc[:50], endogen_variable='Appliances') \ No newline at end of file + new_df = som.apply(df.iloc[:50], endogen_variable='Appliances', epochs=100, leaning_rate=0.1) + print(new_df.head()) \ No newline at end of file