Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Boosting | Boosting Algorithms
Ensemble Learning Techniques with Python

bookChallenge: Boosting

Tâche

Swipe to start coding

Your task is to train and evaluate two boosting models — AdaBoost and Gradient Boosting — on the Breast Cancer dataset.

Follow these steps:

  1. Load the dataset using load_breast_cancer() from sklearn.datasets.
  2. Split the data into training and testing sets (test_size=0.3, random_state=42).
  3. Train:
    • An AdaBoostClassifier with:
      • base_estimator=DecisionTreeClassifier(max_depth=1)
      • n_estimators=50, learning_rate=0.8
    • A GradientBoostingClassifier with:
      • n_estimators=100, learning_rate=0.1, max_depth=3.
  4. Evaluate both models on the test data using accuracy_score.
  5. Print both accuracies.

Solution

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 3. Chapitre 4
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

close

bookChallenge: Boosting

Glissez pour afficher le menu

Tâche

Swipe to start coding

Your task is to train and evaluate two boosting models — AdaBoost and Gradient Boosting — on the Breast Cancer dataset.

Follow these steps:

  1. Load the dataset using load_breast_cancer() from sklearn.datasets.
  2. Split the data into training and testing sets (test_size=0.3, random_state=42).
  3. Train:
    • An AdaBoostClassifier with:
      • base_estimator=DecisionTreeClassifier(max_depth=1)
      • n_estimators=50, learning_rate=0.8
    • A GradientBoostingClassifier with:
      • n_estimators=100, learning_rate=0.1, max_depth=3.
  4. Evaluate both models on the test data using accuracy_score.
  5. Print both accuracies.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 3. Chapitre 4
single

single

some-alt