Problem 1: Train a Bagging Classifier
Easypython
Learn the Concept: Ensemble TechniquesProblem Description
Write a Python program that trains a BaggingClassifier using Decision Trees as the base estimator, and predicts the class for a new data point.
Input
A labeled dataset and one new data point.
Output
The predicted class.
Constraints
- At least 8 labeled examples.
Example Input
textX=[[1,60],[2,65],[8,95],[9,98],[4,72],[6,88],[3,68],[7,91]], y=[0,0,1,1,0,1,0,1], new=[[5,80]]
Example Output
textPrediction: [1]
Concepts Covered
BaggingClassifier, .fit(), .predict().
Related Problems
- Problem 2: Train an AdaBoost ClassifierEasy · pythonSolve Problem
- Problem 3: Compare Gradient Boosting with Different n_estimatorsEasy · pythonSolve Problem
- Problem 4: Build a Stacking Classifier with Two Base ModelsEasy · pythonSolve Problem