Skip to main content

Decision Tree Pruning

Pruning is a technique in decision tree that reduces the size of trees by removing sections of the tree that are non-critical and redundant to classify instances.

Pruned trees tend to be smaller and less complex. They are usually faster and better in classifying independent test data correctly.

There are two approaches to carry out tree pruning. They are prepruning and postpruning.

The prepruning apporoach is used at the early constrcution stage of decison tree. Hence further split of the tree is stopped at the given node, which become leaf node of the tree. This approach would overcome the overfitting issue.

The postpruning approach is the one in which subtrees are removed from the fully grown tree.

The cost complexity algorithm of CART and pessimistic pruning of C4.5 are example of the postpruning approach.

Popular posts from this blog

Matrix Eigenvalues & Eigenvectors

The process of finding an unknown scalar, λ and a nonzero vector, x for a given non zero square matrix, A of dimension n x n is called matrix eigenvalue or eigenvalue. Ax = λ x The λ and x which satisfies the above equation is called eigen value and eigenvector. Ax should be proportional to x. The multiplication will produce a new vector that will have the same or opposite direction as the original vector. The set of all the eigenvalues of A is called the  spectrum of A. The largest of the absolute values of the  eigenvalues of A is called the spectral radius of A. To determine eigenvalue and eigenvector, the equation can be written in matrix notation, (A - λI)x = 0 By Cramer's theorem,  the  homogeneous linear system of equations has a  nontrivial solution if and only if the corresponding determinant of the coefficients is zero. A - λI is called characteristic matrix and D( λ) is characteristic determinant of A. The above equation is called characteristic ...

Gaussian Elimination - Row reduction Algorithm

 Gaussian elimination is a method for solving matrix equations of the form, Ax=b.  This method is also known as the row reduction algorithm. Back  Substitution Solving the last equation for the variable and then work backward into the first equation to solve it.  The fundamental idea is to add multiples of one equation to the others in order to eliminate a variable and to continue this process until only one variable is left. Pivot row The row that is used to perform elimination of a variable from other rows is called the pivot row. Example: Solving a linear equation The augmented matrix for the above equation shall be The equation shall be solved using back substitution. The eliminating the first variable (x1) in the first row (Pivot row) by carrying out the row operation. As the second row become zero, the row will be shifted to bottom by carrying out partial pivoting. Now, the second variable (x2)  shall be eliminated by carrying out the row operation again. ...

Function - One to One & Onto

  One to One A function f from A to B is called one-to-one (or 1-1) if whenever f (a) = f (b) then a = b. No element of B is the image of more than one element in A. In a one-to-one function, given any y there is only one x that can be paired with the given y. f is one-to-one ( injective ) if f maps every element of A to a unique element in B. In other words no element of B are mapped to by two or more elements of A. Onto A function f from A to B is called onto if for all b in B there is an a in A such that f (a) = b. All elements in B are used. f is onto ( surjective )if every element of B is mapped to by some element of A. In other words, nothing is left out. f is one-to-one onto ( bijective ) if it is both one-to-one and onto. In this case the map f is also called a one-to-one correspondence. Notice that “f is one-to-one” is asserting uniqueness, while “f is onto” is asserting existence. Let A and B be two finite sets such that there is a function f: A -> B. We claim the foll...