Add 'train.py'
This commit is contained in:
parent
e188640f06
commit
07b9558387
21
train.py
Normal file
21
train.py
Normal file
@ -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')
|
Loading…
Reference in New Issue
Block a user