Skip to content

Commit 2211b3f

Browse files
Merge pull request #171 from mdiephuis/master
Fixed two tiny python typos
2 parents c0f0cee + e4526ae commit 2211b3f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Chapter5_LossFunctions/LossFunctions.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@
814814
" \"\"\"vectorized for numpy\"\"\"\n",
815815
" sol = np.zeros_like(price)\n",
816816
" ix = price*pred < 0 \n",
817-
" sol[ix] = coef*pred**2 - sign(price[ix])*pred + abs(price[ix])\n",
817+
" sol[ix] = coef*pred**2 - np.sign(price[ix])*pred + abs(price[ix])\n",
818818
" sol[ ~ix ] = abs( price[~ix] - pred )\n",
819819
" return sol\n",
820820
"\n",
@@ -845,7 +845,7 @@
845845
"plt.title( \"Least-squares prediction vs. Bayes action prediction\" )\n",
846846
"plt.plot( X, ls_coef_*X + ls_intercept, label =\"Least-squares prediction\")\n",
847847
"plt.xlim( X.min(), X.max())\n",
848-
"plot( trading_signals, opt_predictions, label =\"Bayes action prediction\")\n",
848+
"plt.plot( trading_signals, opt_predictions, label =\"Bayes action prediction\")\n",
849849
"plt.legend( loc=\"upper left\" );"
850850
],
851851
"language": "python",

0 commit comments

Comments
 (0)