
Alexandr
Programming Machine Learning: Incorrect formula
Hi everyone!
There is an error on the page 71 in the book “Programming machine learning from coding to depp learning” P. Perrotta. You can’t just change the weighted sum to a sigmoid without first taking the derivative of the sigmoid. See the explanation there https://yadi.sk/i/T75bWimUYPAe7Q
Best regards.
Marked As Solved

nusco
Hey, Alexandr! Thank you for taking the time to report this, and even take a picture of your notes!
I kinda regret not putting that calculation in the book, because from the explanation I wrote, it looks like the derivative of the sigmoid just disappeared. Actually, the formula in the book does take that derivative into account. The sigmoid isn’t explicit in the final formula, but it’s baked into the values of y-hat.
It’s been a while since I went through the steps myself, but I googled for a step-by-step calculation and found this one: https://medium.com/analytics-vidhya/derivative-of-log-loss-function-for-logistic-regression-9b832f025c2d
My apologies for not writing the steps by hand (busy day!), but I checked the calculation in the link above, and I cannot see any obvious errors. If you do, can you please point them out?
Popular Prag Prog topics










Other popular topics










Latest in PragProg
Latest (all)
Categories:
Popular Portals
- /elixir
- /opensuse
- /rust
- /kotlin
- /ruby
- /erlang
- /python
- /clojure
- /react
- /quarkus
- /go
- /vapor
- /react-native
- /v
- /wasm
- /django
- /security
- /nodejs
- /centos
- /rails
- /haskell
- /fable
- /gleam
- /js
- /swift
- /deno
- /tailwind
- /assemblyscript
- /laravel
- /symfony
- /phoenix
- /crystal
- /typescript
- /debian
- /adonisjs
- /julia
- /arch-linux
- /svelte
- /spring
- /c-plus-plus
- /flutter
- /preact
- /actix
- /java
- /angular
- /ocaml
- /zig
- /scala
- /kubuntu
- /zotonic
- /vim
- /rocky
- /lisp
- /html
- /keyboards
- /nim
- /vuejs
- /emacs
- /elm
- /nerves