diff --git a/site/en/tutorials/structured_data/imbalanced_data.ipynb b/site/en/tutorials/structured_data/imbalanced_data.ipynb index 8ca2de46218..df9f33417cc 100644 --- a/site/en/tutorials/structured_data/imbalanced_data.ipynb +++ b/site/en/tutorials/structured_data/imbalanced_data.ipynb @@ -345,11 +345,11 @@ "pos_df = pd.DataFrame(train_features[ bool_train_labels], columns=train_df.columns)\n", "neg_df = pd.DataFrame(train_features[~bool_train_labels], columns=train_df.columns)\n", "\n", - "sns.jointplot(pos_df['V5'], pos_df['V6'],\n", + "sns.jointplot(x=pos_df['V5'], y=pos_df['V6'],\n", " kind='hex', xlim=(-5,5), ylim=(-5,5))\n", "plt.suptitle(\"Positive distribution\")\n", "\n", - "sns.jointplot(neg_df['V5'], neg_df['V6'],\n", + "sns.jointplot(x=neg_df['V5'], y=neg_df['V6'],\n", " kind='hex', xlim=(-5,5), ylim=(-5,5))\n", "_ = plt.suptitle(\"Negative distribution\")" ] @@ -814,7 +814,7 @@ " else:\n", " plt.ylim([0,1])\n", "\n", - " plt.legend()" + " plt.legend();" ] }, { @@ -960,7 +960,7 @@ "source": [ "plot_roc(\"Train Baseline\", train_labels, train_predictions_baseline, color=colors[0])\n", "plot_roc(\"Test Baseline\", test_labels, test_predictions_baseline, color=colors[0], linestyle='--')\n", - "plt.legend(loc='lower right')" + "plt.legend(loc='lower right');" ] }, { @@ -1003,7 +1003,7 @@ "source": [ "plot_prc(\"Train Baseline\", train_labels, train_predictions_baseline, color=colors[0])\r\n", "plot_prc(\"Test Baseline\", test_labels, test_predictions_baseline, color=colors[0], linestyle='--')\r\n", - "plt.legend(loc='lower right')" + "plt.legend(loc='lower right');" ] }, { @@ -1180,7 +1180,7 @@ "plot_roc(\"Test Weighted\", test_labels, test_predictions_weighted, color=colors[1], linestyle='--')\n", "\n", "\n", - "plt.legend(loc='lower right')" + "plt.legend(loc='lower right');" ] }, { @@ -1207,7 +1207,7 @@ "plot_prc(\"Test Weighted\", test_labels, test_predictions_weighted, color=colors[1], linestyle='--')\r\n", "\r\n", "\r\n", - "plt.legend(loc='lower right')" + "plt.legend(loc='lower right');" ] }, { @@ -1359,7 +1359,7 @@ "id": "sLEfjZO0-vbN" }, "source": [ - "Merge the two together using `experimental.sample_from_datasets`:" + "Merge the two together using `tf.data.Dataset.sample_from_datasets`:" ] }, { @@ -1370,7 +1370,7 @@ }, "outputs": [], "source": [ - "resampled_ds = tf.data.experimental.sample_from_datasets([pos_ds, neg_ds], weights=[0.5, 0.5])\n", + "resampled_ds = tf.data.Dataset.sample_from_datasets([pos_ds, neg_ds], weights=[0.5, 0.5])\n", "resampled_ds = resampled_ds.batch(BATCH_SIZE).prefetch(2)" ] }, @@ -1610,7 +1610,7 @@ "\n", "plot_roc(\"Train Resampled\", train_labels, train_predictions_resampled, color=colors[2])\n", "plot_roc(\"Test Resampled\", test_labels, test_predictions_resampled, color=colors[2], linestyle='--')\n", - "plt.legend(loc='lower right')" + "plt.legend(loc='lower right');" ] }, { @@ -1638,7 +1638,7 @@ "\r\n", "plot_prc(\"Train Resampled\", train_labels, train_predictions_resampled, color=colors[2])\r\n", "plot_prc(\"Test Resampled\", test_labels, test_predictions_resampled, color=colors[2], linestyle='--')\r\n", - "plt.legend(loc='lower right')" + "plt.legend(loc='lower right');" ] }, {