Skip to content
C

Decision Tree vs Random Forest Comparison

Mediumpython

Using the notes' own customer-purchase dataset, train both a DecisionTreeClassifier and a RandomForestClassifier, and compare their predictions for a given new customer.

Approach: fit both models (with a fixed random_state for reproducibility) on the same small dataset, then predict for the given [age, income] pair with each.

Input: Two lines: a customer's age, then their income.

Output: Two lines: the Decision Tree's prediction, then the Random Forest's prediction (0 or 1).

Input (stdin)

Output

Run your code to see output here...