Skip to content

Commit c577477

Browse files
Merge pull request #1996 from rabinadk1:patch-1
PiperOrigin-RevId: 421487357
2 parents 9d47dff + 251b0d6 commit c577477

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

site/en/tutorials/structured_data/imbalanced_data.ipynb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,11 @@
345345
"pos_df = pd.DataFrame(train_features[ bool_train_labels], columns=train_df.columns)\n",
346346
"neg_df = pd.DataFrame(train_features[~bool_train_labels], columns=train_df.columns)\n",
347347
"\n",
348-
"sns.jointplot(pos_df['V5'], pos_df['V6'],\n",
348+
"sns.jointplot(x=pos_df['V5'], y=pos_df['V6'],\n",
349349
" kind='hex', xlim=(-5,5), ylim=(-5,5))\n",
350350
"plt.suptitle(\"Positive distribution\")\n",
351351
"\n",
352-
"sns.jointplot(neg_df['V5'], neg_df['V6'],\n",
352+
"sns.jointplot(x=neg_df['V5'], y=neg_df['V6'],\n",
353353
" kind='hex', xlim=(-5,5), ylim=(-5,5))\n",
354354
"_ = plt.suptitle(\"Negative distribution\")"
355355
]
@@ -814,7 +814,7 @@
814814
" else:\n",
815815
" plt.ylim([0,1])\n",
816816
"\n",
817-
" plt.legend()"
817+
" plt.legend();"
818818
]
819819
},
820820
{
@@ -960,7 +960,7 @@
960960
"source": [
961961
"plot_roc(\"Train Baseline\", train_labels, train_predictions_baseline, color=colors[0])\n",
962962
"plot_roc(\"Test Baseline\", test_labels, test_predictions_baseline, color=colors[0], linestyle='--')\n",
963-
"plt.legend(loc='lower right')"
963+
"plt.legend(loc='lower right');"
964964
]
965965
},
966966
{
@@ -1003,7 +1003,7 @@
10031003
"source": [
10041004
"plot_prc(\"Train Baseline\", train_labels, train_predictions_baseline, color=colors[0])\r\n",
10051005
"plot_prc(\"Test Baseline\", test_labels, test_predictions_baseline, color=colors[0], linestyle='--')\r\n",
1006-
"plt.legend(loc='lower right')"
1006+
"plt.legend(loc='lower right');"
10071007
]
10081008
},
10091009
{
@@ -1180,7 +1180,7 @@
11801180
"plot_roc(\"Test Weighted\", test_labels, test_predictions_weighted, color=colors[1], linestyle='--')\n",
11811181
"\n",
11821182
"\n",
1183-
"plt.legend(loc='lower right')"
1183+
"plt.legend(loc='lower right');"
11841184
]
11851185
},
11861186
{
@@ -1207,7 +1207,7 @@
12071207
"plot_prc(\"Test Weighted\", test_labels, test_predictions_weighted, color=colors[1], linestyle='--')\r\n",
12081208
"\r\n",
12091209
"\r\n",
1210-
"plt.legend(loc='lower right')"
1210+
"plt.legend(loc='lower right');"
12111211
]
12121212
},
12131213
{
@@ -1359,7 +1359,7 @@
13591359
"id": "sLEfjZO0-vbN"
13601360
},
13611361
"source": [
1362-
"Merge the two together using `experimental.sample_from_datasets`:"
1362+
"Merge the two together using `tf.data.Dataset.sample_from_datasets`:"
13631363
]
13641364
},
13651365
{
@@ -1370,7 +1370,7 @@
13701370
},
13711371
"outputs": [],
13721372
"source": [
1373-
"resampled_ds = tf.data.experimental.sample_from_datasets([pos_ds, neg_ds], weights=[0.5, 0.5])\n",
1373+
"resampled_ds = tf.data.Dataset.sample_from_datasets([pos_ds, neg_ds], weights=[0.5, 0.5])\n",
13741374
"resampled_ds = resampled_ds.batch(BATCH_SIZE).prefetch(2)"
13751375
]
13761376
},
@@ -1610,7 +1610,7 @@
16101610
"\n",
16111611
"plot_roc(\"Train Resampled\", train_labels, train_predictions_resampled, color=colors[2])\n",
16121612
"plot_roc(\"Test Resampled\", test_labels, test_predictions_resampled, color=colors[2], linestyle='--')\n",
1613-
"plt.legend(loc='lower right')"
1613+
"plt.legend(loc='lower right');"
16141614
]
16151615
},
16161616
{
@@ -1638,7 +1638,7 @@
16381638
"\r\n",
16391639
"plot_prc(\"Train Resampled\", train_labels, train_predictions_resampled, color=colors[2])\r\n",
16401640
"plot_prc(\"Test Resampled\", test_labels, test_predictions_resampled, color=colors[2], linestyle='--')\r\n",
1641-
"plt.legend(loc='lower right')"
1641+
"plt.legend(loc='lower right');"
16421642
]
16431643
},
16441644
{

0 commit comments

Comments
 (0)