Challenge: Boosting
Tarefa
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:
- Load the dataset using
load_breast_cancer()fromsklearn.datasets. - Split the data into training and testing sets (
test_size=0.3,random_state=42). - 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.
- An AdaBoostClassifier with:
- Evaluate both models on the test data using
accuracy_score. - Print both accuracies.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 3. Capítulo 4
single
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
Suggested prompts:
Can you explain this in simpler terms?
What are the main points I should remember?
Can you give me an example?
Incrível!
Completion taxa melhorada para 7.14
Challenge: Boosting
Deslize para mostrar o menu
Tarefa
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:
- Load the dataset using
load_breast_cancer()fromsklearn.datasets. - Split the data into training and testing sets (
test_size=0.3,random_state=42). - 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.
- An AdaBoostClassifier with:
- Evaluate both models on the test data using
accuracy_score. - Print both accuracies.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 3. Capítulo 4
single