
The AI universe series (part 9); Decision Trees & SVMs
Decision Trees and Support Vector Machines (SVMs) are two foundational supervised-learning algorithms in the AI universe. Both learn from labelled examples to classify data or predict values, but they approach the task very differently: trees build a sequence of rules, while SVMs draw an optimal separating boundary.
Decision Trees
A decision tree predicts an outcome by asking a series of questions about a data point’s features. It starts at a root node, splits the data into branches, and reaches a leaf node that contains the final prediction.
For example, a bank might classify a loan application using questions such as: “Is income above $30,000?” and “Is the credit score above 650?” The algorithm selects splits that create purer groups, commonly measured using Gini impurity or entropy and information gain.
Decision trees are popular because they are visual, interpretable, and easy to convert into if–then business rules. However, an unrestricted tree can become too complex and overfit, memorising noise rather than learning general patterns. Limiting tree depth, requiring minimum samples per leaf, and pruning help control this.
Support Vector Machines
An SVM is a supervised algorithm that classifies data by finding the best hyperplane—the boundary that separates classes with the largest possible margin. The points closest to that boundary are called "support vectors", because they define the margin and influence the final model.
When classes cannot be separated by a straight line, SVMs use the kernel trick. Kernels such as linear, polynomial, and radial basis function (RBF) implicitly map data into a higher-dimensional space, where a linear boundary can separate the classes.
SVMs are especially useful for high-dimensional data, such as text or image features. Their main trade-off is that kernel choice and parameters such as `C` and `gamma` must be tuned carefully.
Which should you use?
Choose a decision tree when explainability and clear decision rules matter. Choose an SVM when you need strong performance on complex or high-dimensional data. In practice, data scientists often test both, tune them with cross-validation, and select the model that generalises best to unseen data.
Key idea: Decision trees ask, “Which questions best explain the outcome?” SVMs ask, “Which boundary separates the classes most reliably?”



Comments