From 07b9558387819edde9158e7266266cb50b848144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Ga=C5=82ka?= Date: Wed, 10 May 2023 20:20:22 +0200 Subject: [PATCH] Add 'train.py' --- train.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 train.py diff --git a/train.py b/train.py new file mode 100644 index 0000000..b843f12 --- /dev/null +++ b/train.py @@ -0,0 +1,21 @@ +train_data_x = pandas.read_csv('./X_train.csv') + + +games_all = train_data_x.copy() +games_predict = train_data_x.pop('User_Score') +normalize = layers.Normalization() +normalize.adapt(games_all) + +norm_games_model = tensorflow.keras.Sequential([ + normalize, + layers.Dense(64), + layers.Dense(1) +]) + +norm_games_model.compile( + loss=tensorflow.keras.losses.MeanSquaredError(), + optimizer=tensorflow.keras.optimizers.Adam()) + +norm_games_model.fit(games_all, games_predict, epochs=500) + +norm_games_model.save('test') \ No newline at end of file