text_html_output_1.png
from tensorflow import keras

from tensorflow.keras import layers

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import tensorflow as tf

import tensorflow_docs as tfdocs

import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
tf.debugging.set_log_device_placement(False)

dataset = pd.read_csv('/kaggle/input/pubg-finish-placement-prediction/train_V2.csv')[['damageDealt', 'headshotKills', 'killPlace', 'boosts', 'heals', 'winPlacePerc']].dropna()

train_dataset = dataset.sample(frac=0.9, random_state=0)
test_dataset = dataset.drop(train_dataset.index)

train_stats = train_dataset.describe()
train_stats.pop("winPlacePerc")
train_stats = train_stats.transpose()
train_stats

train_labels = train_dataset.pop('winPlacePerc')
test_labels = test_dataset.pop('winPlacePerc')

def norm(x):
    return (x - train_stats['mean']) / train_stats['std']
normed_train_data = norm(train_dataset)
normed_test_data = norm(test_dataset)

def build_model():
    model = keras.Sequential([layers.Dense(64, activation='relu', input_shape=(len(train_dataset.keys()),)), layers.Dense(64, activation='relu'), layers.Dense(1)])
    optimizer = tf.keras.optimizers.Adam(learning_rate=0.001, beta_1=0.9, beta_2=0.999, amsgrad=False)
    model.compile(loss='mae', optimizer=optimizer, metrics=['mae', 'mse'])
    return model

model = build_model()
early_stop = keras.callbacks.EarlyStopping(monitor='val_loss', patience=10)

EPOCHS = 2
history = model.fit(normed_train_data, train_labels, epochs=EPOCHS, validation_split=0.2, verbose=1, batch_size=300, callbacks=[early_stop, tfdocs.modeling.EpochDots()])