MLT Answer Key
MLT Answer Key
(AUTONOMOUS)
B.E / B.Tech INTERNAL ASSESSMENT EXAMINATION–II, SEP-
2024
V- Semester
20AI502 MACHINE LEARNING TECHNIQUES
PART - A
The activation function decides whether a neuron should be activated or not by calculating the weighted sum and
further adding bias to it. The purpose of the activation function is to introduce non-linearity into the output of a
neuron.
1. Activation Function: MLP uses non-linear activation functions like sigmoid, ReLU, or tanh in
its hidden layers.
2. Architecture: The network learns weights for connections between layers and processes data
through fully connected layers.
2. Architecture: RBFN has a two-layer architecture where the first layer uses radial basis
functions, and the output layer is typically linear.
PART – B
10 a)Explain multi-layer perceptron model with going forward and going backward
The simplest kind of feed-forward network is a multilayer perceptron (MLP), as shown in Figure 1.
The units are arranged into a set of layers, and each layer contains some number of identical units.
Every unit in one layer is connected to every unit in the next layer; we say that the network is fully
connected. The first layer is the input layer, and its units take the values of the input features.
The last layer is the output layer, and it has one unit for each value the network outputs.
All the layers in between these are known as hidden layers
The units in these layers are known as input units, output units, and hidden units, respectively.
The number of layers is known as the depth, and the number of units in a layer is known as the width.
Training of MLP
target output for node k is tk, the difference between the actual output and the expected output is given
by:
Going Backward
Finally, Backpropagation is derived by assuming that it is desirable to minimize the error on the output
nodes over all the patterns presented to the neural network. The following equation is used to calculate
the error function, E, for all patterns
Output Layer
If the actual activation value of the output node, k, is Ok, and the expected target output for node k is tk,
the difference between the actual output and the expected output is given by:
The error signal for node k in the output layer can be calculated as
where is the change in the weight between nodes j and k, lr is the learning rate.
Hidden Layer
The error signal for node j in the hidden layer can be calculated as
where the Sum term adds the weighted error signal for all nodes, k, in the output layer.
As before, the formula to adjust the weight, wi,j, between the input node, i, and the node, j is:
The input layer is made up of source nodes (sensory units) whose number is equal to the dimension p
of the input vector u.
Hidden layer
The second layer is the hidden layer which is composed of nonlinear units that are connected directly
to all of the nodes in the input layer.
Each hidden unit takes its input from all the nodes at the components at the input layer. As mentioned
above the hidden units contains a basis function, which has the parameters center and width. The
center of the basis function for a node i at the hidden layer is a vector ci whose size is the as the input
vector u and there is normally a different center for each unit in the network.
First, the radial distance di, between the input vector u and the center of the basis function ci is
computed for each unit i in the hidden layer as
Output layer
The transformation from the input space to the hidden unit space is nonlinear, whereas the
transformation to the hidden unit space to the output space is linear.
The jth output is computed as
In summary, the mathematical model of the RBF network can be expressed as:
Decision Trees:
A Trees has nodes. and branches.
Rooted tree has a root and Children node and also there will leaves without children.
A decision tree is a tree is also a classifier
The tree has two types of nodes:
1. Decision nodes/ specify a choice
2. leaf Nodes.
1. Decision Node:
It Specify a choice or a test base on this you can decide which direction we can go.
This test is usually done on the Valuer of a feature (or) attribute of the instance.
The test is on some attribute and there is a branch for each outcome.
2. Leaf Node:
Leaf Node indicates the classification of an example or value of the example.
Example:
Whether loan will approve
If all the examples in D1 have the same output Y then there is no need expand node D1, But if there are
different values, then the node should be split further.
K-Means Clustering is an Unsupervised Learning algorithm, which groups the unlabeled dataset into
different clusters.
Here K defines the number of pre-defined clusters that need to be created in the process, as if K=2,
there will be two clusters, and for K=3, there will be three clusters, and so on.
It is an iterative algorithm that divides the unlabeled dataset into k different clusters in such a way that
each dataset belongs only one group that has similar properties.
It allows us to cluster the data into different groups and a convenient way to discover the categories of
groups in the unlabeled dataset on its own without the need for any training.
It is a centroid-based algorithm, where each cluster is associated with a centroid.
The main aim of this algorithm is to minimize the sum of distances between the data point and their
corresponding clusters.
The k-means clustering algorithm mainly performs two tasks:
Determines the best value for K center points or centroids by an iterative process.
Assigns each data point to its closest k-center. Those data points which are near to the particular k-
center, create a cluster.
The working of the K-Means algorithm is explained in the below steps:
Step-1: Select the number K to decide the number of clusters.
Step-2: Select random K points or centroids.
Step-3: Assign each data point to their closest centroid, which will form the predefined K clusters.
Step-4: Calculate the variance and place a new centroid of each cluster.
Step-5: Repeat the third steps, which means reassign each datapoint to the new closest centroid of each
cluster.
Step-6: If any reassignment occurs, then go to step-4 else go to FINISH.