MachineLearning/decision_tree library

🌳 Decision Tree Classifier (CART-style, numeric features)

A compact CART-style decision tree classifier for numeric features using Gini impurity and greedy splits. Supports a maxDepth parameter and minSamplesSplit to avoid overfitting. Designed for clarity and small datasets; uses recursion to build a tree of splits.

Contract:

  • Input: feature matrix X (n x m) and integer labels y (0..k-1).
  • Output: DecisionTreeClassifier object with fit and predict.

Time Complexity: O(n * m * n_splits) per depth (naive) Space Complexity: O(n)