<jupyter_start><jupyter_text><jupyter_code>train_score=train_main_data_set["Burn Rate"]
train_data_set=train_main_data_set.drop((["Burn Rate"]),axis=1)
train_data_set

only_train_data,val_data,only_train_score,val_burn_rate=train_test_split(train_data_set, train_score, test_size=0.20, shuffle=True)
val_burn_rate.shape
from sklearn.preprocessing import StandardScaler

scaler=StandardScaler()
only_train_data=scaler.fit_transform(only_train_data)
val_data=scaler.transform(val_data)
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from tensorflow.keras.callbacks import EarlyStopping
from tensorflow.keras.layers import BatchNormalization<jupyter_output><empty_output><jupyter_text><jupyter_code>model=Sequential()
model.add(Dense(128,activation="relu",input_shape=(train_data_set.shape[1],)))
model.add(Dense(256,activation="relu"))
model.add(Dense(256,activation="relu"))
model.add(Dense(256,activation="relu"))
model.add(BatchNormalization())
model.add(Dense(1,activation="linear"))
model.summary()
model.compile(optimizer="adam",loss="mean_absolute_error",metrics=["mean_absolute_error"])
history=model.fit(x=only_train_data,y=only_train_score,epochs=500,validation_data=(val_data,val_burn_rate),)
def plot(data,string):
  plt.plot(data.history[string])
  plt.plot(data.history["val_"+string])
  plt.xlabel("epochs")
  plt.ylabel(string)
  plt.legend([string,"val_"+string])
  plt.show()

plot(history,"mean_absolute_error")
from sklearn.metrics import r2_score
train_pred=model.predict(only_train_data)
val_pred=model.predict(val_data)
train_r2=r2_score(train_pred,only_train_score)
val_r2=r2_score(val_pred,val_burn_rate)
print(train_r2)
print(val_r2)
test_main_data_set
burn_rate_pred=model.predict(test_main_data_set)
result=pd.DataFrame()

result["Employee ID"]=test_data["Employee ID"]
result["Burn Rate"]=burn_rate_pred

from google.colab import drive
drive.mount('/content/drive')
result.to_csv('/content/drive/My Drive/Hacker_Earth_Burn_out_rate.csv',index=False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1303088803088803, 'fraction_numerical': 0.013513513513513514, 'mean_word_length': 13.395833333333334, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '506636', 'license': 'MIT', 'n_tokens_mistral': 777, 'n_tokens_neox': 751, 'n_words': 80, 'path': 'Hacker_Earth_Burn_out_rate_.ipynb', 'repo_name': 'Naveen-Reddy55/Burn-out-Rate', 'size': '2072'}