ium_z434686/train.py

31 lines
699 B
Python
Raw Normal View History

2023-05-10 20:30:03 +02:00
import pandas
import os
from keras.applications.densenet import layers
from sklearn.model_selection import train_test_split
import tensorflow
2023-05-10 22:39:12 +02:00
EPOCHS = int(os.environ['EPOCHS'])
2023-05-10 20:30:03 +02:00
2023-05-10 20:20:22 +02:00
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())
2023-05-10 22:39:12 +02:00
norm_games_model.fit(games_all, games_predict, epochs=EPOCHS)
2023-05-10 20:20:22 +02:00
norm_games_model.save('test')