From 6e85d0fce67daa637e7ed3f2def93b9bcff0f7a8 Mon Sep 17 00:00:00 2001 From: Abhijith Gandrakota Date: Wed, 19 Jul 2023 13:03:03 -0400 Subject: [PATCH] change val to test --- part2/2.JetTaggingMLP.ipynb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/part2/2.JetTaggingMLP.ipynb b/part2/2.JetTaggingMLP.ipynb index 66f68df..1ddb9f5 100644 --- a/part2/2.JetTaggingMLP.ipynb +++ b/part2/2.JetTaggingMLP.ipynb @@ -202,8 +202,8 @@ "outputs": [], "source": [ "from sklearn.model_selection import train_test_split\n", - "X_train, X_val, y_train, y_val = train_test_split(features, target, test_size=0.33)\n", - "print(X_train.shape, X_val.shape, y_train.shape, y_val.shape)\n", + "X_train, X_test, y_train, y_test = train_test_split(features, target, test_size=0.2)\n", + "print(X_train.shape, X_test.shape, y_train.shape, y_test.shape)\n", "del features, target" ] }, @@ -318,7 +318,7 @@ "\n", "# train \n", "history = model.fit(X_train, y_train, epochs=n_epochs, batch_size=batch_size, verbose = 2,\n", - " validation_data=(X_val, y_val), learning_rate=0.01,\n", + " validation_split=0.2,\n", " # callbacks = [\n", " # EarlyStopping(monitor='val_loss', patience=10, verbose=1),\n", " # ReduceLROnPlateau(monitor='val_loss', factor=0.1, patience=2, verbose=1),\n", @@ -364,7 +364,7 @@ "source": [ "import pandas as pd\n", "from sklearn.metrics import roc_curve, auc\n", - "predict_val = model.predict(X_val)\n", + "predict_test = model.predict(X_test)\n", "df = pd.DataFrame()\n", "fpr = {}\n", "tpr = {}\n", @@ -372,8 +372,8 @@ "\n", "plt.figure()\n", "for i, label in enumerate(labels):\n", - " df[label] = y_val[:,i]\n", - " df[label + '_pred'] = predict_val[:,i]\n", + " df[label] = y_test[:,i]\n", + " df[label + '_pred'] = predict_test[:,i]\n", "\n", " fpr[label], tpr[label], threshold = roc_curve(df[label],df[label+'_pred'])\n", "\n",