Posts

2.10 Normalization

Image
  Normalization: -   Normalization is a data pre-processing technique used to scale numerical features data into a standard range. It ensures that all input features contribute equally to the model and improves convergence of machine learning algorithms. Normalization is a technique used to scale numbers into a common range . It makes big values and small values come to a similar level. Normalization scales features to a standard range to improve model performance. Need for Normalization Features may have different ranges Large-scale values can dominate small-scale values Some algorithms depend on distance calculations Normalization helps: Improve model accuracy Speed up training process Improve convergence in gradient-based algorithms Example: - Imagine a dataset: Age = 18 to 60 Salary = 10,000 to 1,00,000 Salary values are much bigger than age values. If we train a model: The model may give more importance to salary Age may get ignored So we normalize t...

2.9 Feature Pruning

Feature Pruning: - Feature Pruning is a technique in machine learning used to simplify a model by removing unnecessary parts such as branches in decision trees or redundant weights in neural networks.  The main aim is to make the model smaller, faster, and more efficient while maintaining good accuracy. When a model becomes too complex, it may learn noise from the training data. This leads to overfitting , where the model performs well on training data but poorly on new data. Pruning helps reduce this problem. Feature pruning is an important technique to improve model performance. It reduces overfitting, increases interpretability, and improves computational efficiency. By removing unnecessary components, we get a smaller, faster, and more accurate model suitable for real-world applications. Objectives of Feature Pruning Reduce Overfitting Pruning removes parts of the model that capture noise or irrelevant patterns in training data. This improves performance on test data Impr...

2.8 Importance of Good Features in Machine Learning

Image
Importance of Good Features in Machine Learning In machine learning, a feature means a piece of information that helps a computer understand something. Features are the input variables used by a machine learning model.                                               Features = Information used by the model to learn. Example: If we want to identify an image, the image data becomes the feature. If we want to classify text , words become features. If we want to identify a dog, the features help us? It has four legs It has fur It barks It has ears and a tail These details are called features . Machine learning works on a simple rule:  Garbage in → Garbage out If we give poor quality data (bad features), the model gives poor results. Good Features Are Important Because: Improve model accuracy. Reduce training time. Improve genera...

2.7 Activation Functions of Perceptron

Image
  Activation Functions of Perceptron: - The activation function applies a step rule (convert the numerical output into +1 or -1) to check if the output of the weighting function is greater than zero or not. Step function gets triggered above a certain value of the neuron output; else it outputs zero. Sign Function outputs +1 or -1 depending on whether neuron output is greater than zero or not. Sigmoid function is the S-curve and outputs a value between 0 and 1. Lines in 2D Space A line in 2D space is represented by the equation (y = mx + c), where (m) is the slope, and C is the y-intercept. This can be seen as the simplest form of a decision boundary, separating the plane into two halves. In vector notation, considering vectors (a) and (b) for points on the line, the equation can be expressed as                                         a.b = 0 when the line p...

2.6 Perceptron Convergence and Linear Separability

Image
Perceptron Convergence and Linear Separability The perceptron algorithm converges only when the dataset is linearly separable . If the data cannot be separated by a straight line or hyperplane, the algorithm will not converge. Algorithm:   The perceptron convergence theorem states that, for any data set which is linearly separable, the perception learning rule or algorithm will converge to a solution in finite no of iterations or find a solution in a finite number of steps. The perceptron learning algorithm updates its weight vector  w  using the following rule:   The update is performed only when the perceptron misclassifies a data point. The theorem guarantees that:  If the data is linearly separable , the perceptron algorithm will converge in a finite number of steps . If the data is not linearly separable , the perceptron will continue updating indefinitely. Linear Separability A dataset is linearly separable if we can separate the two classe...