Skip to content
CampusEduX

Problem 3: Compare Gradient Boosting with Different n_estimators

Easypython
Learn the Concept: Ensemble Techniques

Problem Description

Write a Python program that trains GradientBoostingClassifier models with n_estimators set to 10, 50, and 100, comparing their training accuracy to observe the effect of adding more boosting rounds.

Input

A labeled dataset.

Output

Training accuracy for each configuration.

Constraints

  • At least 10 labeled examples.

Example Input

text
(A labeled dataset with 10+ examples)

Example Output

text
n_estimators=10: Train accuracy = 0.90 n_estimators=50: Train accuracy = 0.98 n_estimators=100: Train accuracy = 1.00

Concepts Covered

GradientBoostingClassifier, n_estimators, training accuracy.

Related Problems

  • Problem 1: Train a Bagging Classifier
    Easy · python
    Solve Problem
  • Problem 2: Train an AdaBoost Classifier
    Easy · python
    Solve Problem
  • Problem 4: Build a Stacking Classifier with Two Base Models
    Easy · python
    Solve Problem

Input (stdin)

Output

Run your code to see output here...