• About
  • Advertise
  • Privacy & Policy
  • Contact
Thursday, January 8, 2026
  • Login
  • Home
    • Home – Layout 1
    • Home – Layout 2
    • Home – Layout 3
    • Home – Layout 4
    • Home – Layout 5
    • Home – Layout 6
  • News
    • All
    • Business
    • Politics
    • Science
    • World
    Hillary Clinton in white pantsuit for Trump inauguration

    Hillary Clinton in white pantsuit for Trump inauguration

    Amazon has 143 billion reasons to keep adding more perks to Prime

    Amazon has 143 billion reasons to keep adding more perks to Prime

    Shooting More than 40 Years of New York’s Halloween Parade

    Shooting More than 40 Years of New York’s Halloween Parade

    These Are the 5 Big Tech Stories to Watch in 2017

    These Are the 5 Big Tech Stories to Watch in 2017

    Why Millennials Need to Save Twice as Much as Boomers Did

    Why Millennials Need to Save Twice as Much as Boomers Did

    Doctors take inspiration from online dating to build organ transplant AI

    Doctors take inspiration from online dating to build organ transplant AI

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Tech
    • All
    • Apps
    • Gadget
    • Mobile
    • Startup
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    Shadow Tactics: Blades of the Shogun Review

    Shadow Tactics: Blades of the Shogun Review

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    The Last Guardian Playstation 4 Game review

    The Last Guardian Playstation 4 Game review

    These Are the 5 Big Tech Stories to Watch in 2017

    These Are the 5 Big Tech Stories to Watch in 2017

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
  • Entertainment
    • All
    • Gaming
    • Movie
    • Music
    • Sports
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Harnessing the power of VR with Power Rangers and Snapdragon 835

    Harnessing the power of VR with Power Rangers and Snapdragon 835

    So you want to be a startup investor? Here are things you should know

    So you want to be a startup investor? Here are things you should know

  • Lifestyle
    • All
    • Fashion
    • Food
    • Health
    • Travel
    Shooting More than 40 Years of New York’s Halloween Parade

    Shooting More than 40 Years of New York’s Halloween Parade

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Why Millennials Need to Save Twice as Much as Boomers Did

    Why Millennials Need to Save Twice as Much as Boomers Did

    Doctors take inspiration from online dating to build organ transplant AI

    Doctors take inspiration from online dating to build organ transplant AI

    How couples can solve lighting disagreements for good

    How couples can solve lighting disagreements for good

    Ducati launch: Lorenzo and Dovizioso’s Desmosedici

    Ducati launch: Lorenzo and Dovizioso’s Desmosedici

    Trending Tags

    • Golden Globes
    • Game of Thrones
    • MotoGP 2017
    • eSports
    • Fashion Week
  • Review
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    Shadow Tactics: Blades of the Shogun Review

    Shadow Tactics: Blades of the Shogun Review

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    The Last Guardian Playstation 4 Game review

    The Last Guardian Playstation 4 Game review

    Intel Core i7-7700K ‘Kaby Lake’ review

    Intel Core i7-7700K ‘Kaby Lake’ review

No Result
View All Result
Ai News
Advertisement
  • Home
    • Home – Layout 1
    • Home – Layout 2
    • Home – Layout 3
    • Home – Layout 4
    • Home – Layout 5
    • Home – Layout 6
  • News
    • All
    • Business
    • Politics
    • Science
    • World
    Hillary Clinton in white pantsuit for Trump inauguration

    Hillary Clinton in white pantsuit for Trump inauguration

    Amazon has 143 billion reasons to keep adding more perks to Prime

    Amazon has 143 billion reasons to keep adding more perks to Prime

    Shooting More than 40 Years of New York’s Halloween Parade

    Shooting More than 40 Years of New York’s Halloween Parade

    These Are the 5 Big Tech Stories to Watch in 2017

    These Are the 5 Big Tech Stories to Watch in 2017

    Why Millennials Need to Save Twice as Much as Boomers Did

    Why Millennials Need to Save Twice as Much as Boomers Did

    Doctors take inspiration from online dating to build organ transplant AI

    Doctors take inspiration from online dating to build organ transplant AI

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Tech
    • All
    • Apps
    • Gadget
    • Mobile
    • Startup
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    Shadow Tactics: Blades of the Shogun Review

    Shadow Tactics: Blades of the Shogun Review

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    The Last Guardian Playstation 4 Game review

    The Last Guardian Playstation 4 Game review

    These Are the 5 Big Tech Stories to Watch in 2017

    These Are the 5 Big Tech Stories to Watch in 2017

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
  • Entertainment
    • All
    • Gaming
    • Movie
    • Music
    • Sports
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Harnessing the power of VR with Power Rangers and Snapdragon 835

    Harnessing the power of VR with Power Rangers and Snapdragon 835

    So you want to be a startup investor? Here are things you should know

    So you want to be a startup investor? Here are things you should know

  • Lifestyle
    • All
    • Fashion
    • Food
    • Health
    • Travel
    Shooting More than 40 Years of New York’s Halloween Parade

    Shooting More than 40 Years of New York’s Halloween Parade

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Why Millennials Need to Save Twice as Much as Boomers Did

    Why Millennials Need to Save Twice as Much as Boomers Did

    Doctors take inspiration from online dating to build organ transplant AI

    Doctors take inspiration from online dating to build organ transplant AI

    How couples can solve lighting disagreements for good

    How couples can solve lighting disagreements for good

    Ducati launch: Lorenzo and Dovizioso’s Desmosedici

    Ducati launch: Lorenzo and Dovizioso’s Desmosedici

    Trending Tags

    • Golden Globes
    • Game of Thrones
    • MotoGP 2017
    • eSports
    • Fashion Week
  • Review
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    Shadow Tactics: Blades of the Shogun Review

    Shadow Tactics: Blades of the Shogun Review

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    The Last Guardian Playstation 4 Game review

    The Last Guardian Playstation 4 Game review

    Intel Core i7-7700K ‘Kaby Lake’ review

    Intel Core i7-7700K ‘Kaby Lake’ review

No Result
View All Result
Ai News
No Result
View All Result
Home Machine Learning

The Machine Learning “Advent Calendar” Day 14: Softmax Regression in Excel

AiNEWS2025 by AiNEWS2025
2025-12-15
in Machine Learning
0
The Machine Learning “Advent Calendar” Day 14: Softmax Regression in Excel
0
SHARES
0
VIEWS
Share on FacebookShare on Twitter


With Logistic Regression, we learned how to classify into two classes.

Now, what happens if there are more than two classes.

n is simply the multiclass extension of this idea. And we will discuss this model for Day 14 of my Machine Learning “Advent Calendar” (follow this link to get all the information about the approach and the files I use).

Instead of one score, we now create one score per class. Instead of one probability, we apply the Softmax function to produce probabilities that sum to 1.

Understanding the Softmax model

Before training the model, let us first understand what the model is.

Softmax Regression is not about optimization yet.
It is first about how predictions are computed.

A tiny dataset with 3 classes

Let us use a small dataset with one feature x and three classes.

As we said before, the target variable y should not be treated as numerical.
It represents categories, not quantities.

A common way to represent this is one-hot encoding, where each class is represented by its own indicator.

From this point of view, Softmax Regression can be seen as three Logistic Regressions running in parallel, one per class.

Small datasets are ideal for learning.
You can see every formula, every value, and how each part of the model contributes to the final result.

Softmax regression in Excel – All images by author

Description of the Model

So what is the model, exactly?

Score per class

In logistic regression, the model score is a simple linear expression: score = a * x + b.

Softmax Regression does exactly the same, but one score per class:

score_0 = a0 * x + b0
score_1 = a1 * x + b1
score_2 = a2 * x + b2

At this stage, these scores are just real numbers.
They are not probabilities yet.

Turning scores into probabilities: the Softmax step

Softmax converts the three scores into three probabilities. Each probability is positive, and all three sum to 1.

The computation is direct:

  1. Exponentiate each score
  2. Compute the sum of all exponentials
  3. Divide each exponential by this sum

This gives us p0, p1, and p2 for each row.

These values represent the model confidence for each class.

At this point, the model is fully defined.
Training the model will simply consist in adjusting the coefficients ak​ and bk​ so that these probabilities match the observed classes as well as possible.

Softmax regression in Excel – All images by author

Visualizing the Softmax model

At this point, the model is fully defined.

We have:

  • one linear score per class
  • a Softmax step that turns these scores into probabilities

Training the model simply consists in adjusting the coefficients aka_kak​ and bkb_kbk​ so that these probabilities match the observed classes as well as possible.

Once the coefficients have been found, we can visualize the model behavior.

To do this, we take a range of input values, for example x from 0 to 7, and we compute: score0,score1,score2 and the corresponding probabilities p0,p1,p2.

Plotting these probabilities gives three smooth curves, one per class.

Softmax regression in Excel – All images by author

The result is very intuitive.

For small values of x, the probability of class 0 is high.
As x increases, this probability decreases, while the probability of class 1 increases.
For larger values of x, the probability of class 2 becomes dominant.

At every value of x, the three probabilities sum to 1.
The model does not make abrupt decisions; instead, it expresses how confident it is in each class.

This plot makes the behavior of Softmax Regression easy to understand.

  • You can see how the model transitions smoothly from one class to another
  • Decision boundaries correspond to intersections between probability curves
  • The model logic becomes visible, not abstract

This is one of the key benefits of building the model in Excel:
you do not just compute predictions, you can see how the model thinks.

Now that the model is defined, we need a way to evaluate how good it is, and a method to improve its coefficients.

Both steps reuse ideas we already saw with Logistic Regression.

Evaluating the model: Cross-Entropy Loss

Softmax Regression uses the same loss function as Logistic Regression.

For each data point, we look at the probability assigned to the correct class, and we take the negative logarithm:

loss = – log (p true class)

If the model assigns a high probability to the correct class, the loss is small.
If it assigns a low probability, the loss becomes large.

In Excel, this is very simple to implement.

We select the correct probability based on the value of y, and apply the logarithm:

loss = -LN( CHOOSE(y + 1, p0, p1, p2) )

Finally, we compute the average loss over all rows.
This average loss is the quantity we want to minimize.

Softmax regression in Excel – All images by author

Computing residuals

To update the coefficients, we start by computing residuals, one per class.

For each row:

  • residual_0 = p0 minus 1 if y equals 0, otherwise 0
  • residual_1 = p1 minus 1 if y equals 1, otherwise 0
  • residual_2 = p2 minus 1 if y equals 2, otherwise 0

In other words, for the correct class, we subtract 1.
For the other classes, we subtract 0.

These residuals measure how far the predicted probabilities are from what we expect.

Computing the gradients

The gradients are obtained by combining the residuals with the feature values.

For each class k:

  • the gradient of ak is the average of residual_k * x
  • the gradient of bk is the average of residual_k

In Excel, this is implemented with simple formulas such as SUMPRODUCT and AVERAGE.

At this point, everything is explicit:
you see the residuals, the gradients, and how each data point contributes.

Screenshot

Updating the coefficients

Once the gradients are known, we update the coefficients using gradient descent.

This step is identical as we saw before, fore Logistic Regression or Linear regression.
The only difference is that we now update six coefficients instead of two.

To visualize learning, we create a second sheet with one row per iteration:

  • the current iteration number
  • the six coefficients (a0, b0, a1, b1, a2, b2)
  • the loss
  • the gradients

Row 2 corresponds to iteration 0, with the initial coefficients.

Row 3 computes the updated coefficients using the gradients from row 2.

By dragging the formulas down for hundreds of rows, we simulate gradient descent over many iterations.

You can then clearly see:

  • the coefficients gradually stabilizing
  • the loss decreasing iteration after iteration

This makes the learning process tangible.
Instead of imagining an optimizer, you can watch the model learn.

Logistic Regression as a Special Case of Softmax Regression

Logistic Regression and Softmax Regression are often presented as different models.

In reality, they are the same idea at different scales.

Softmax Regression computes one linear score per class and turns these scores into probabilities by comparing them.
When there are only two classes, this comparison depends only on the difference between the two scores.

This difference is a linear function of the input, and applying Softmax in this case produces exactly the logistic (sigmoid) function.

In other words, Logistic Regression is simply Softmax Regression applied to two classes, with redundant parameters removed.

Once this is understood, moving from binary to multiclass classification becomes a natural extension, not a conceptual jump.

Softmax Regression does not introduce a new way of thinking.

It simply shows that Logistic Regression already contained everything we needed.

By duplicating the linear score once per class and normalizing them with Softmax, we move from binary decisions to multiclass probabilities without changing the underlying logic.

The loss is the same idea.
The gradients are the same structure.
The optimization is the same gradient descent we already know.

What changes is only the number of parallel scores.

Another Way to Handle Multiclass Classification?

Softmax is not the only way to deal with multiclass problems in weight-based models.

There is another approach, less elegant conceptually, but very common in practice:
one-vs-rest or one-vs-one classification.

Instead of building a single multiclass model, we train several binary models and combine their results.
This strategy is used extensively with Support Vector Machines.

Tomorrow, we will look at SVM.
And you will see that it can be explained in a rather unusual way… and, as usual, directly in Excel.

Source link

#Machine #Learning #Advent #Calendar #Day #Softmax #Regression #Excel

Tags: artificial intelligencedata sciencemachine learningStatistics
Previous Post

Google Translate expands live translation to all earbuds on Android

Next Post

The cultural alignment of Large Language Models and the effects of prompt language and cultural prompting

AiNEWS2025

AiNEWS2025

Next Post
The cultural alignment of Large Language Models and the effects of prompt language and cultural prompting

The cultural alignment of Large Language Models and the effects of prompt language and cultural prompting

Stay Connected test

  • 23.9k Followers
  • 99 Subscribers
  • Trending
  • Comments
  • Latest
A tiny new open source AI model performs as well as powerful big ones

A tiny new open source AI model performs as well as powerful big ones

0
Water Cooler Small Talk: The Birthday Paradox 🎂🎉 | by Maria Mouschoutzi, PhD | Sep, 2024

Water Cooler Small Talk: The Birthday Paradox 🎂🎉 | by Maria Mouschoutzi, PhD | Sep, 2024

0
Ghost of Yōtei: The acclaimed Ghost of Tsushima is getting a sequel

Ghost of Yōtei: The acclaimed Ghost of Tsushima is getting a sequel

0
Best Headphones for Working Out (2024): Bose, Shokz, JLab

Best Headphones for Working Out (2024): Bose, Shokz, JLab

0
From Manual Reports to Generative and Agentic AI Automation in Finance – with Pavlé Sabic of Moody’s

From Manual Reports to Generative and Agentic AI Automation in Finance – with Pavlé Sabic of Moody’s

2026-01-08
The man who made India digital isn’t done yet

The man who made India digital isn’t done yet

2026-01-08
I Evaluated Half a Million Credit Records with Federated Learning. Here’s What I Found

I Evaluated Half a Million Credit Records with Federated Learning. Here’s What I Found

2026-01-08
Volvo says new EX60 has 400-mile range, charges up to 400 kW

Volvo says new EX60 has 400-mile range, charges up to 400 kW

2026-01-08

Recent News

From Manual Reports to Generative and Agentic AI Automation in Finance – with Pavlé Sabic of Moody’s

From Manual Reports to Generative and Agentic AI Automation in Finance – with Pavlé Sabic of Moody’s

2026-01-08
The man who made India digital isn’t done yet

The man who made India digital isn’t done yet

2026-01-08
I Evaluated Half a Million Credit Records with Federated Learning. Here’s What I Found

I Evaluated Half a Million Credit Records with Federated Learning. Here’s What I Found

2026-01-08
Volvo says new EX60 has 400-mile range, charges up to 400 kW

Volvo says new EX60 has 400-mile range, charges up to 400 kW

2026-01-08
Footer logo

We bring you the best Premium WordPress Themes that perfect for news, magazine, personal blog, etc. Check our landing page for details.

Follow Us

Browse by Category

  • AI & Cloud Computing
  • AI & Cybersecurity
  • AI & Sentiment Analysis
  • AI Applications
  • AI Ethics
  • AI Future Predictions
  • AI in Education
  • AI in Fintech
  • AI in Gaming
  • AI in Healthcare
  • AI in Startups
  • AI Innovations
  • AI News
  • AI Research
  • AI Tools & Automation
  • Apps
  • AR/VR & AI
  • Business
  • Deep Learning
  • Emerging Technologies
  • Entertainment
  • Fashion
  • Food
  • Gadget
  • Gaming
  • Health
  • Lifestyle
  • Machine Learning
  • Mobile
  • Movie
  • Music
  • News
  • Politics
  • Review
  • Robotics & Smart Systems
  • Science
  • Sports
  • Startup
  • Tech
  • Travel
  • World

Recent News

From Manual Reports to Generative and Agentic AI Automation in Finance – with Pavlé Sabic of Moody’s

From Manual Reports to Generative and Agentic AI Automation in Finance – with Pavlé Sabic of Moody’s

2026-01-08
The man who made India digital isn’t done yet

The man who made India digital isn’t done yet

2026-01-08
  • About
  • Advertise
  • Privacy & Policy
  • Contact

© 2026 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
No Result
View All Result

© 2026 JNews - Premium WordPress news & magazine theme by Jegtheme.