Skip to content

Commit

Permalink
clarify cost_ in the docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
rasbt committed Dec 27, 2016
1 parent 29b22a0 commit e45b187
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions code/ch02/ch02.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
" w_ : 1d-array\n",
" Weights after fitting.\n",
" errors_ : list\n",
" Number of misclassifications in every epoch.\n",
" Number of misclassifications (updates) in each epoch.\n",
"\n",
" \"\"\"\n",
" def __init__(self, eta=0.01, n_iter=10):\n",
Expand Down Expand Up @@ -1040,8 +1040,8 @@
" -----------\n",
" w_ : 1d-array\n",
" Weights after fitting.\n",
" errors_ : list\n",
" Number of misclassifications in every epoch.\n",
" cost_ : list\n",
" Sum-of-squares cost function value in each epoch.\n",
"\n",
" \"\"\"\n",
" def __init__(self, eta=0.01, n_iter=50):\n",
Expand Down Expand Up @@ -1280,8 +1280,9 @@
" -----------\n",
" w_ : 1d-array\n",
" Weights after fitting.\n",
" errors_ : list\n",
" Number of misclassifications in every epoch.\n",
" cost_ : list\n",
" Sum-of-squares cost function value averaged over all\n",
" training samples in each epoch.\n",
" shuffle : bool (default: True)\n",
" Shuffles training data every epoch if True to prevent cycles.\n",
" random_state : int (default: None)\n",
Expand Down
11 changes: 6 additions & 5 deletions code/optional-py-scripts/ch02.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Perceptron(object):
w_ : 1d-array
Weights after fitting.
errors_ : list
Number of misclassifications in every epoch.
Number of misclassifications (updates) in each epoch.
"""
def __init__(self, eta=0.01, n_iter=10):
Expand Down Expand Up @@ -188,8 +188,8 @@ class AdalineGD(object):
-----------
w_ : 1d-array
Weights after fitting.
errors_ : list
Number of misclassifications in every epoch.
cost_ : list
Sum-of-squares cost function value in each epoch.
"""
def __init__(self, eta=0.01, n_iter=50):
Expand Down Expand Up @@ -302,8 +302,9 @@ class AdalineSGD(object):
-----------
w_ : 1d-array
Weights after fitting.
errors_ : list
Number of misclassifications in every epoch.
cost_ : list
Sum-of-squares cost function value averaged over all
training samples in each epoch.
shuffle : bool (default: True)
Shuffles training data every epoch if True to prevent cycles.
random_state : int (default: None)
Expand Down

0 comments on commit e45b187

Please sign in to comment.