Posts

Showing posts from August, 2024

Machine Learning (Chapter 32): Stopping Criteria & Pruning

Image
  Machine Learning (Chapter 32): Stopping Criteria & Pruning Stopping Criteria In machine learning, particularly in iterative algorithms like decision trees, neural networks, and gradient-based optimization methods, stopping criteria are crucial for ensuring that the algorithm converges efficiently without overfitting or underfitting. Stopping criteria determine when to halt the training process based on certain conditions. 1. Stopping Criteria for Iterative Algorithms For iterative algorithms, stopping criteria can include: Maximum Iterations : The algorithm stops after a predefined number of iterations. Stop if  k ≥ K \text{Stop if } k \geq K Stop if  k ≥ K where k k k is the current iteration and K K K is the maximum number of iterations. Convergence of Loss Function : The algorithm stops if the change in the loss function between iterations is below a threshold ϵ \epsilon ϵ . Stop if  ∣ L k + 1 − L k ∣ < ϵ \text{Stop if } |L_{k+1} - L_k| ...

Machine Learning (Chapter 31): Regression Trees

Image
  Machine Learning (Chapter 31): Regression Trees Introduction to Regression Trees Regression Trees are a type of decision tree used for predicting a continuous value or numerical outcome. They partition the data into subsets that are more homogeneous with respect to the response variable. The tree is built by recursively splitting the data based on feature values to minimize a certain error metric, commonly the mean squared error (MSE). Structure of a Regression Tree A regression tree consists of nodes and branches: Root Node : Represents the entire dataset. Internal Nodes : Represent decisions based on the values of one or more features. Leaf Nodes : Represent the predicted values, which are the average of the target variable in that subset. Mathematical Formulation The process of building a regression tree can be described as follows: Splitting Criterion : For each node, the data is split into two subsets by choosing a feature x j x_j x j ​ and a split point s s s that minimiz...

Machine Learning (Chapter 30): Decision Trees - Introduction

Image
  Machine Learning (Chapter 30): Decision Trees - Introduction Overview Decision Trees are one of the most popular and intuitive models in machine learning. They are used for both classification and regression tasks. A decision tree is a flowchart-like structure where each internal node represents a decision on an attribute, each branch represents the outcome of that decision, and each leaf node represents a class label (in classification) or a continuous value (in regression). 1. Components of a Decision Tree Root Node : The top node of the tree that represents the best predictor. Internal Nodes : These represent features (or attributes) and are decision points in the tree. Branches : They connect nodes, representing the outcome of a decision. Leaf Nodes : The terminal nodes that represent the outcome (classification or value). 2. Building a Decision Tree The goal in constructing a decision tree is to create a model that predicts the target variable by learning simple decision rul...

Machine Learning (Chapter 29): Parameter Estimation III - Bayesian Estimation

Image
  Machine Learning (Chapter 29): Parameter Estimation III - Bayesian Estimation Bayesian Estimation is a powerful statistical technique that extends the principles of Bayesian inference to parameter estimation. Unlike Maximum Likelihood Estimation (MLE) which focuses solely on finding the parameter values that maximize the likelihood function, Bayesian Estimation incorporates prior knowledge or beliefs about the parameters and updates these beliefs with data. This chapter explores the mathematical foundation of Bayesian Estimation, provides examples, and includes Python code to demonstrate the concepts. 1. Introduction to Bayesian Estimation Bayesian Estimation is based on Bayes' Theorem, which is used to update the probability of a hypothesis as more evidence becomes available. In the context of parameter estimation, the hypothesis represents the parameters of a model, and the evidence is the observed data. Bayes' Theorem is mathematically expressed as: P ( θ ∣ X ) = P ( X ∣ θ...