Data Mining: An Introduction to Neural Networks in SQL Server

This article provides an introduction to Microsoft Neural Network algorithm in SQL Server. It covers the use of neural networks for predictive analytics (whether a customer is likely to be a buyer) based on stored customer information.
There are several definitions for both business and scientific data mining. Data mining is a method of automatically sorting large amounts of data to discover behaviors, patterns, and trends. It enables companies to make proactive, data driven decisions. Data Mining helps to discover patterns from large data sets by using its historical experience (stored in relational databases or cubes) to predict the future
So why don’t we use traditional datawarehouse? Datawarehouses are good for descriptive analysis (like what happened) and diagnostic analysis (why it happened). However, companies also need to do deep analysis and that is where Data mining can help with predictive analytics
Artificial Intelligence, machine learning and deep learning are now commonly used terms. Things have certainly progressed a lot over the last few years with use of AI in various aspects of everyday life including conversational AI like chatbots for customer service etc.
Truly intelligent machines would be the ones that can learn, reason, and make decisions like humans. Neural Networks (NNs) are the perhaps the closest to provide the answer.
Human brains are made up of connected networks of neurons (nerve cells). NNs try to mimic these networks. This would enable “machines” to learn and make decisions just like Humans do
Our Brain is arranged or structured in layers. Different layers in our brain process information and pass it on to the next layer. Information that comes in is processed by neurons of the layer, provide an insight and then pass that data/insight to the next layer.
Let’s take an example of freshly baked Muffin from your favorite café and your subsequent decision making. Our brain processes the smell of freshly baked Muffins in multiple stages. Initially you smell the Muffin (data input) and then you think “I like Muffins” (thought – next layer) and then “I want at least one Muffin” (decision)
Artificial Neural Networks (ANN) attempt to simulate this layered or multi-level approach to information processing and decision. An ANN can have three basic layers of neurons: the input layer (input data), the hidden layer (core processing layer) and the output layer (decision layer). We are taking a simple example of an ANN but complex ANNs can include multiple hidden layers. The basic principle however remains the same, information flows from one layer to another, just like in the human brain.
Of course, this is a very simplistic view of how our brain works but I hope you get the picture of what “Artificial” Neural Network try to achieve.
Input layer: all the input attribute values for the data mining model, and their probabilities.
Hidden layer: receive data from input layer and supply outputs to next layer. Probabilities of the varied inputs can be assigned weights. A weight refers to importance of an input. You can weigh something as negative which means that this input isn’t favorable
Output layer: predictable value for the model
Microsoft Neural Network in SQL Server is generally more advanced than Decision Trees and Naïve Bayes.
A neural network model must contain a key, inputs (one or more), and predictable values (one or multiple). Data mining models are affected by the values that are specified for the parameters that are available to the algorithm
If you are conversant with Adventureworks, we’ll use Age and Gender as inputs for the input layer
The Hidden layer is the middle layer that expects a weightage to every input
All predicted attributes are mapped to the Output layer. In this example, it’s the customer of the bicycle
A neuron combines multiple inputs with different techniques. Similarly, Microsoft Neural Network uses Weighted Sum. Maximum, Average, logical AND, logical OR.


