Fix perceptron interactive learning rate to use scatter

This commit is contained in:
renzaoren666 2026-08-05 01:03:26 +08:00
parent 33e781bf7b
commit d5e211958c
1 changed files with 2 additions and 2 deletions

View File

@ -470,8 +470,8 @@
" \n",
" ax1.set_xlim(-6, 6)\n",
" ax1.set_ylim(-6, 6)\n",
" ax1.plot(pos_examples[:, 0], pos_examples[:, 1], 'bo', label='Positive', s=100, alpha=0.6)\n",
" ax1.plot(neg_examples[:, 0], neg_examples[:, 1], 'ro', label='Negative', s=100, alpha=0.6)\n",
" ax1.scatter(pos_examples[:, 0], pos_examples[:, 1], color='blue', marker='o', s=100, alpha=0.6, label='Positive')\n",
" ax1.scatter(neg_examples[:, 0], neg_examples[:, 1], color='red', marker='o', s=100, alpha=0.6, label='Negative')\n",
" ax1.plot(x, y, 'g-', linewidth=3, label='Decision Boundary')\n",
" ax1.set_title(f'Decision Boundary (lr={learning_rate})', fontsize=14)\n",
" ax1.set_xlabel('Feature 1')\n",