Close Menu
    Facebook LinkedIn YouTube WhatsApp X (Twitter) Pinterest
    Trending
    • Canyon Spectral:ON CF 8 Electric Mountain Bike: Beginner-Friendly, Under $5K
    • US-sanctioned currency exchange says $15 million heist done by “unfriendly states”
    • This New Air Purifier Filter Can Remove Cannabis Smoke Odor, Just in Time for 4/20
    • Portable water filter provides safe drinking water from any source
    • MAGA Is Increasingly Convinced the Trump Assassination Attempt Was Staged
    • NCAA seeks faster trial over DraftKings disputed March Madness branding case
    • AI Trusted Less Than Social Media and Airlines, With Grok Placing Last, Survey Says
    • Extragalactic Archaeology tells the ‘life story’ of a whole galaxy
    Facebook LinkedIn WhatsApp
    Times FeaturedTimes Featured
    Saturday, April 18
    • Home
    • Founders
    • Startups
    • Technology
    • Profiles
    • Entrepreneurs
    • Leaders
    • Students
    • VC Funds
    • More
      • AI
      • Robotics
      • Industries
      • Global
    Times FeaturedTimes Featured
    Home»Artificial Intelligence»The Machine Learning “Advent Calendar” Day 18: Neural Network Classifier in Excel
    Artificial Intelligence

    The Machine Learning “Advent Calendar” Day 18: Neural Network Classifier in Excel

    Editor Times FeaturedBy Editor Times FeaturedDecember 18, 2025No Comments12 Mins Read
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr WhatsApp Email
    Share
    Facebook Twitter LinkedIn Pinterest Telegram Email WhatsApp Copy Link


    Neural Network Regressor, we now transfer to the classifier model.

    From a mathematical viewpoint, the 2 fashions are very related. Actually, they differ primarily by the interpretation of the output and the selection of the loss operate.

    Nevertheless, this classifier model is the place instinct often turns into a lot stronger.

    In apply, neural networks are used way more usually for classification than for regression. Considering when it comes to possibilities, determination boundaries, and lessons makes the function of neurons and layers simpler to know.

    On this article, you will notice:

    • how one can outline the construction of a neural community in an intuitive means,
    • why the variety of neurons issues,
    • and why a single hidden layer is already enough, a minimum of in principle.

    At this level, a pure query arises:
    If one hidden layer is sufficient, why can we discuss a lot about deep studying?

    The reply is necessary.

    Deep studying is not nearly stacking many hidden layers on high of one another. Depth helps, however it isn’t the entire story. What actually issues is how representations are constructed, reused, and constrained, and why deeper architectures are extra environment friendly to coach and generalize in apply.

    We are going to come again to this distinction later. For now, we intentionally preserve the community small, so that each computation will be understood, written, and checked by hand.

    That is one of the simplest ways to actually perceive how a neural community classifier works.

    As with the neural community regressor we constructed yesterday, we are going to break up the work into two elements.

    First, we take a look at ahead propagation and outline the neural community as a set mathematical operate that maps inputs to predicted possibilities.

    Then, we transfer to backpropagation, the place we prepare this operate by minimizing the log loss utilizing gradient descent.

    The rules are precisely the identical as earlier than. Solely the interpretation of the output and the loss operate change.

    1. Ahead propagation

    On this part, we concentrate on just one factor: the mannequin itself. No coaching but. Simply the operate.

    1.1 A easy dataset and the instinct of constructing a operate

    We begin with a really small dataset:

    • 12 observations
    • One single characteristic x
    • A binary goal y

    The dataset is deliberately easy so that each computation will be adopted manually. Nevertheless, it has one necessary property: the lessons are not linearly separable.

    Which means that a easy logistic regression can not clear up the issue, no matter how effectively it’s educated.

    Dataset for Neural Community Classifier – all photographs by writer

    Nevertheless, the instinct is exactly the other of what it might appear at first.

    What we’re going to do is construct two logistic regressions first. Each creates a reduce within the enter house, as illustrated beneath.

    In different phrases, we begin with one single characteristic, and we rework it into two new options.

    Neural Community Classifier – all photographs by writer

    Then, we apply one other logistic regression, this time on these two options, to acquire the ultimate output chance.

    When written as a single mathematical expression, the ensuing operate is already a bit complicated to learn. That is precisely why we use a diagram: not as a result of the diagram is extra correct, however as a result of it’s simpler to grasp how the operate is constructed by composition.

    Neural Community Classifier – all photographs by writer

    1.2 Neural Community Construction

    So the visible diagram represents the next mannequin:

    • One hidden layer with two neurons within the hidden layer, which permits us to signify the 2 cuts we observe within the dataset
    • One output neuron, and it’s a logistic regression right here.
    Neural Community Classifier – all photographs by writer

    In our case, the mannequin is determined by seven coefficients:

    • Weights and biases for the 2 hidden neurons
    • Weights and bias for the output neuron

    Taken collectively, these seven numbers totally outline the mannequin.

    Now, for those who already perceive how a neural community classifier works, here’s a query for you:

    What number of completely different options can this mannequin have?

    In different phrases, what number of distinct units of seven coefficients can produce the identical classification boundary, or nearly the identical predicted possibilities, on this dataset?

    1.3 Implementing ahead propagation in Excel

    We now implement the mannequin utilizing Excel formulation.

    To visualise the output of the neural community, we generate new values of x starting from −2 to 2 with a step of 0.02.

    For every worth of x, we compute:

    • The outputs of the 2 hidden neurons (A1​ and A2​)
    • The ultimate output of the community

    At this stage, the mannequin isn’t educated but. We due to this fact want to repair the seven parameters of the community. For now, we merely use a set of cheap values, proven beneath, which permits us to visualise the ahead propagation of the mannequin.

    It is only one attainable configuration of the parameters. Even earlier than coaching, this already raises an fascinating query: what number of completely different parameter configurations might produce a sound answer for this drawback?

    Coefficients selected for the neural community (picture by writer)

    We will use the next equations to compute the values of the hidden layers and the output.

    Neural Community Classifier – all photographs by writer

    The intermediate values A1 and A2​ are displayed explicitly. This avoids giant, unreadable formulation and makes the ahead propagation simple to comply with.

    Formulation for ahead propagation (picture by the writer)

    The dataset has been efficiently divided into two distinct lessons utilizing the neural community.

    Visualization of the output of the neural community — picture by the writer

    1.4 Ahead propagation: abstract and observations

    To recap, we began with a easy coaching dataset and outlined a neural community as an express mathematical operate, applied utilizing easy Excel formulation and a set set of coefficients. By feeding new values of xxx into this operate, we had been capable of visualize the output of the neural community and observe the way it separates the information.

    Neural Community Classifier – all photographs by writer

    Now, for those who look intently on the shapes produced by the hidden layer, which comprises the 2 logistic regressions, you’ll be able to see that there are 4 attainable configurations. They correspond to the completely different attainable orientations of the slopes of the 2 logistic features.

    Every hidden neuron can have both a optimistic or a unfavorable slope. With two neurons, this results in 2×2=4 attainable combos. These completely different configurations can produce very related determination boundaries on the output, despite the fact that the underlying parameters are completely different.

    This explains why the mannequin can admit a number of options for a similar classification drawback.

    Neural Community Classifier – all photographs by writer

    The tougher half is now to find out the values of those coefficients.

    That is the place backpropagation comes into play.

    2. Backpropagation: coaching the neural community with gradient descent

    As soon as the mannequin is outlined, coaching turns into a numerical drawback.

    Regardless of its title, backpropagation isn’t a separate algorithm. It’s merely gradient descent utilized to a composed operate.

    2.1 Reminder of the backpropagation algorithm

    The precept is similar for all weight-based fashions.

    We first outline the mannequin, that’s, the mathematical operate that maps the enter to the output.

    Then we outline the loss operate. Since it is a binary classification job, we use log loss, precisely as in logistic regression.

    Lastly, in an effort to be taught the coefficients, we compute the partial derivatives of the loss with respect to every coefficient of the mannequin. These derivatives are what enable us to replace the parameters utilizing gradient descent.

    Beneath is a screenshot displaying the ultimate formulation for these partial derivatives.

    Neural Community Classifier – all photographs by writer

    The backpropagation algorithm can then be summarized as follows:

    1. Initialize the weights of the neural community randomly.
    2. Feedforward the inputs via the neural community to get the anticipated output.
    3. Calculate the error between the anticipated output and the precise output.
    4. Backpropagate the error via the community to calculate the gradient of the loss operate with respect to the weights.
    5. Replace the weights utilizing the calculated gradient and a studying price.
    6. Repeat steps 2 to five till the mannequin converges.

    2.2 Initialization of the coefficients

    The dataset is organized in columns to make Excel formulation simple to increase.

    Enter knowledge (picture by writer)

    The coefficients are initialized with particular values right here. You may change them, however convergence isn’t assured. Relying on the initialization, the gradient descent might converge to a special answer, converge very slowly, or fail to converge altogether.

    Preliminary values for the coefficients (picture by writer)

    2.3 Ahead propagation

    Within the columns from AG to BP, we implement the ahead propagation step. We first compute the 2 hidden activations A1 and A2, after which the output of the community. These are precisely the identical formulation as these used earlier to outline the ahead propagation of the mannequin.

    To maintain the computations readable, we course of every commentary individually. In consequence, we have now 12 columns for the hidden layer outputs (A1 and A2) and 12 columns for the output layer.

    As an alternative of writing a single summation formulation, we compute the values commentary by commentary. This avoids very giant and hard-to-read formulation, and it makes the logic of the computations a lot clearer.

    This column-wise group additionally makes it simple to imitate a for-loop throughout gradient descent: the formulation can merely be prolonged by row to signify successive iterations.

    Ahead propagation (picture by writer)

    2.4 Errors and the price operate

    Within the columns from BQ to CN, we compute the error phrases and the values of the price operate.

    For every commentary, we consider the log loss based mostly on the anticipated output and the true label. These particular person losses are then mixed to acquire the entire price for the every iteration.

    Errors and value operate (picture by writer)

    2.5 Partial derivatives

    We now transfer to the computation of the partial derivatives.

    The neural community has 7 coefficients, so we have to compute 7 partial derivatives, one for every parameter. For every by-product, the computation is completed for all 12 observations, which results in a complete of 84 intermediate values.

    To maintain this manageable, the sheet is rigorously organized. The columns are grouped and color-coded so that every by-product will be adopted simply.

    Within the columns from CO to DL, we compute the partial derivatives related to a11 and a12.

    Within the columns from DM to EJ, we compute the partial derivatives related to b11 and b12.

    Partial derivatives — Picture by writer

    Within the columns from EK to FH, we compute the partial derivatives related to a21 and a22.

    Partial derivatives — Picture by writer

    Within the columns from FI to FT, we compute the partial derivatives related to b2.

    Partial derivatives — Picture by writer

    And to wrap it up, we sum the partial derivatives throughout the 12 observations.

    The ensuing gradients are grouped and proven within the columns from Z to FI.

    Partial derivatives — Picture by writer

    2.6 Updating weights in a for loop

    These partial derivatives enable us to carry out gradient descent for every coefficient. The updates are computed within the columns from R to X.

    At every iteration, we will observe how the coefficients evolve. The worth of the price operate is proven in column Y, which makes it simple to see whether or not the descent is working and whether or not the loss is reducing.

    After updating the coefficients at every step of the for loop, we recompute the output of the neural community.

    Picture by writer

    If the preliminary values of the coefficients are poorly chosen, the algorithm might fail to converge or might converge to an undesired answer, even with an affordable step dimension.

    Native minimal neural community (Picture by writer)

    The GIF beneath reveals the output of the neural community at every iteration of the for loop. It helps visualize how the mannequin evolves throughout coaching and the way the choice boundary steadily converges towards an answer.

    Neural community output visualization with weights updating — Picture by writer

    Conclusion

    We’ve now accomplished the complete implementation of a neural community classifier, from ahead propagation to backpropagation, utilizing solely express formulation.

    By constructing the whole lot step-by-step, we have now seen {that a} neural community is nothing greater than a mathematical operate, educated by gradient descent. Ahead propagation defines what the mannequin computes. Backpropagation tells us how one can modify the coefficients to scale back the loss.

    This file permits you to experiment freely: you’ll be able to change the dataset, modify the preliminary values of the coefficients, and observe how the coaching behaves. Relying on the initialization, the mannequin might converge shortly, converge to a special answer, or get caught in a neighborhood minimal.

    By means of this train, the mechanics of neural networks change into concrete. As soon as these foundations are clear, utilizing high-level libraries feels a lot much less opaque, as a result of precisely what is occurring behind the scenes.

    Additional Studying

    Thanks in your help for my Machine Learning “Advent Calendar“.

    Individuals often discuss so much about supervised studying, unsupervised studying is usually neglected, despite the fact that it may be very helpful in lots of conditions. These articles particularly discover these approaches.
    Thanks, and comfortable studying.

    https://towardsdatascience.com/the-machine-learning-advent-calendar-day-5-gmm-in-excel/

    https://towardsdatascience.com/the-machine-learning-advent-calendar-day-10-dbscan-in-excel/

    https://towardsdatascience.com/the-machine-learning-advent-calendar-day-9-lof-in-excel/



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Editor Times Featured
    • Website

    Related Posts

    A Practical Guide to Memory for Autonomous LLM Agents

    April 17, 2026

    You Don’t Need Many Labels to Learn

    April 17, 2026

    Beyond Prompting: Using Agent Skills in Data Science

    April 17, 2026

    6 Things I Learned Building LLMs From Scratch That No Tutorial Teaches You

    April 17, 2026

    Introduction to Deep Evidential Regression for Uncertainty Quantification

    April 17, 2026

    memweave: Zero-Infra AI Agent Memory with Markdown and SQLite — No Vector Database Required

    April 17, 2026

    Comments are closed.

    Editors Picks

    Canyon Spectral:ON CF 8 Electric Mountain Bike: Beginner-Friendly, Under $5K

    April 18, 2026

    US-sanctioned currency exchange says $15 million heist done by “unfriendly states”

    April 18, 2026

    This New Air Purifier Filter Can Remove Cannabis Smoke Odor, Just in Time for 4/20

    April 18, 2026

    Portable water filter provides safe drinking water from any source

    April 18, 2026
    Categories
    • Founders
    • Startups
    • Technology
    • Profiles
    • Entrepreneurs
    • Leaders
    • Students
    • VC Funds
    About Us
    About Us

    Welcome to Times Featured, an AI-driven entrepreneurship growth engine that is transforming the future of work, bridging the digital divide and encouraging younger community inclusion in the 4th Industrial Revolution, and nurturing new market leaders.

    Empowering the growth of profiles, leaders, entrepreneurs businesses, and startups on international landscape.

    Asia-Middle East-Europe-North America-Australia-Africa

    Facebook LinkedIn WhatsApp
    Featured Picks

    Madrid-based Payflow raises €10 million to expand their Earned Wage Access platform across Europe and LAM

    June 2, 2025

    G&A Robot’s coffeebots offer barista-quality, 24/7 smart cafe drinks.

    November 6, 2025

    7 tips for using an air fryer

    January 6, 2025
    Categories
    • Founders
    • Startups
    • Technology
    • Profiles
    • Entrepreneurs
    • Leaders
    • Students
    • VC Funds
    Copyright © 2024 Timesfeatured.com IP Limited. All Rights.
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us

    Type above and press Enter to search. Press Esc to cancel.