LightMySky
به انگلیسی

Logistic Regression and the Decision Boundary

For a yes-or-no target, squeeze a linear score through a function that returns a probability, and fit by maximising likelihood. Where that probability crosses a chosen threshold is the decision boundary, and moving the threshold trades one kind of mistake for the other.

شروع یادگیری این موضوعبه حساب کاربری نیازی نیست. پیشرفت در همین مرورگر ذخیره می‌شود.

کارهایی که یادگیرنده بعد از این درس می‌تواند انجام دهد

  • Turn a linear score into a probability and read off the predicted class
  • Draw the decision boundary of a two-feature logistic model
  • Say what moving the threshold does to each kind of error

۱ · بخوان

Logistic regression starts with a linear score, like z equals b0 plus b1 x1 plus b2 x2, built by weighting each feature and adding a starting value. That score can be any number, so the model squeezes it through the sigmoid curve p equals 1 over 1 plus e to minus z, which lands between 0 and 1 as a probability.

Try it together

A golf model gives a putt p equals 0.72. With a threshold of 0.5, predict yes at or above 0.5, so this putt is predicted in. With a score of z equals 1.1 and e to minus z about one third, the sigmoid gives 1 over 4 thirds, which is 0.75.

With two features the decision boundary is a straight line. Predict yes where the score tops zero and no below it, so the boundary is where the score equals zero. For z equals 2 x1 plus x2 minus 6 that line is 2 x1 plus x2 equals 6, with yes on one side and no on the other.

Moving the threshold trades one mistake for the other: raising it cuts wrong yes calls but grows wrong no calls, and lowering it does the reverse. The weights themselves are fit by maximum likelihood, which picks the weights that make the observed labels most probable, reached by stepping against the slope with a sane step size.

Score the inputs, squeeze to a probability, draw the line at the threshold, and move it to trade the two errors.

The rewritten readings were written for this dataset.

۲ · ببین

به انگلیسی

دور از صفحه‌نمایش

چاپ کاربرگکاغذ A4، با یک صفحهٔ جواب‌ها برای بزرگ‌ترها. بدون صفحه‌نمایش، بدون اینترنت.

جایگاه این موضوع

سپس تمرین

۱۶ سؤال پشت این درس منتظرند، هر کدام با پاسخ توضیح‌داده‌شده. هر پاسخ آسمان را پر می‌کند: ستاره‌ها هنگام یادگیری روشن می‌شوند و وقتی زمان برگشتن است کمرنگ می‌شوند.

شروع یادگیری این موضوع