Urgent.News

What's breaking now, across thousands of outlets.

AI

Logistic Regression

When you start your journey in Machine Learning, the first algorithm you usually learn is Linear Regression. Linear regression draws a straight line using the equation: y = m x + c This straight line is amazing for predicting continuous numbers, like the price of a house or a student's score. But what happens if you want to predict a category? For example, predicting whether a student is Placed (…

Logistic Regression is a foundational algorithm in Machine Learning, typically learned after Linear Regression. While Linear Regression draws a straight line to predict continuous values, Logistic Regression is used for binary classification problems, such as predicting whether a student is Placed (1) or Not Placed (0) based on their exam scores.

Linear Regression struggles with binary data because the line extends infinitely, potentially predicting impossible values. Logistic Regression addresses this by squishing the output into an S-shaped curve between 0 and 1, yielding a probability value (like an 85% chance of being placed).

The training process begins with initializing weights and biases. For n features, n weights and a bias term are needed. In our example with two features (CGPA and IQ), three weights are required. Initially, all weights are set to zero, and the bias is set to zero as well. The model then calculates a raw linear score (z) for each student using its current weights: z = bias + (w1 × CGPA) + (w2 × IQ).

With all weights at zero, Student 1 receives a score of z = 0. This score is then passed through the Sigmoid function to convert it into a probability (p): p = 1 / (1 + e^-z). In the case of z = 0, the probability is 0.5, representing a 50% chance of being placed.

The quality of this guess is evaluated using Binary Cross-Entropy (BCE) Loss, a formula that measures the dissimilarity between the actual and predicted probabilities for each data point in the dataset.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

Pocket Trail: an open-weight model writes you a walk, then tells you to close the tab

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass What I Built Most "get outside" apps want you to stay inside them. Pocket Trail does the opposite.

  • Pocket Trail generates personalized trail cards based on user's desired duration and type of walk.
  • App considers factors like weather, daylight, and moon phase for tailored experience.
  • Open-weight model writes trail descriptions for the app.

What If Our Desktop Had Its Own Little AI Companion? Meet Luna

This is a submission for the MLH x DEV Writing Challenge Meet Luna 🐱 What I Built My husband and I have always liked those little animated desktop pets — the tiny characters that move around your…

  • Luna is an AI desktop companion designed for practical help.
  • Built with Electron, React, TypeScript, and Google's Gemma AI model.
  • Challenges in implementation taught lessons about AI product development.

More from Saturday 10 October →