Mastering Logistic Regression
<p>Logistic regression is one of the most common machine learning algorithms. It can be used to predict the probability of an event occurring, such as whether an incoming email is spam or not, or whether a tumor is malignant or not, based on a given labeled data set.</p>
<p>Due to its simplicity, logistic regression is often used as a baseline against which other, more complex models are evaluated.</p>
<p>The model has the word “logistic” in its name, since it uses the <strong>logistic function</strong> (sigmoid) to convert a linear combination of the input features into probabilities.</p>
<p>It also has the word “regression” in its name, since its output is a continuous value between 0 and 1, although it is typically used as a <strong>binary classifier</strong> by choosing a threshold value (usually 0.5) and classifying inputs with probability greater than the threshold as the positive class, and those below the threshold as the negative class.</p>
<p>In this article we will discuss the logistic regression model in depth, implement it from scratch in Python, and then show its implementation in Scikit-Learn.</p>
<h1>Background: Binary Classification Problems</h1>
<p>Recall that in supervised machine learning problems, we are given a training set of <em>n</em> labeled samples: <em>D</em> = {(<strong>x</strong>₁, <em>y</em>₁), (<strong>x</strong>₂, <em>y</em>₂), … , (<strong>x</strong><em>ₙ, yₙ</em>)}, where <strong>x</strong><em>ᵢ</em> is a <em>m</em>-dimensional vector that contains the <strong>features </strong>of sample <em>i</em>, and <em>yᵢ</em> represents the <strong>label</strong> of that sample. Our goal is to build a model whose predictions are as close as possible to the true labels.</p>
<p><a href="https://towardsdatascience.com/mastering-logistic-regression-3e502686f0ae">Click Here</a></p>