🔹 Decision Tree

Definition: A non-parametric algorithm for both classification and regression. It uses a tree-like model of decisions and their possible consequences.

Key Terminologies

Entropy

Information Gain

from sklearn.tree import DecisionTreeClassifier

dt_model = DecisionTreeClassifier()
dt_model.fit(X_train, y_train)
y_pred_dt = dt_model.predict(X_test)


🔹 Random Forest

Definition: An ensemble technique using multiple decision trees. Effective for both classification and regression tasks.

Understanding Through Analogy

Ensemble Methods