Problem 4: Evaluate the Effect of n_estimators
Easypython
Problem Description
Write a Python program that trains Random Forest models with n_estimators set to 10, 50, and 200, and compares their predictions on the same test point (to observe whether/how predictions stabilize as the number of trees increases).
Input
A labeled dataset and one new data point.
Output
Predictions from all three configurations.
Constraints
- At least 8 labeled training examples.
Example Input
textX=[[1],[2],[3],[7],[8],[9],[10],[11]], y=[0,0,0,1,1,1,1,1], new=[[6]]
Example Output
textn_estimators=10: [1] n_estimators=50: [1] n_estimators=200: [1]
Concepts Covered
n_estimators, model configuration comparison.