Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Challenge: Random Forest | Bagging and Random Forests
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Ensemble Learning Techniques with Python

bookChallenge: Random Forest

Завдання

Swipe to start coding

Train and evaluate a Random Forest Classifier on the Iris dataset. Your task is to:

  1. Load the dataset using sklearn.datasets.load_iris().
  2. Split the data into training and testing sets (test_size=0.3, random_state=42).
  3. Train a RandomForestClassifier with:
    • n_estimators=100,
    • max_depth=4,
    • random_state=42.
  4. Predict labels on the test set.
  5. Compute and print the accuracy score of your model.
  6. Store the trained model in a variable named rf_model and predictions in y_pred.

Рішення

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 2. Розділ 4
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

Suggested prompts:

Can you explain this in simpler terms?

What are the main points I should remember?

Can you give me an example?

close

bookChallenge: Random Forest

Свайпніть щоб показати меню

Завдання

Swipe to start coding

Train and evaluate a Random Forest Classifier on the Iris dataset. Your task is to:

  1. Load the dataset using sklearn.datasets.load_iris().
  2. Split the data into training and testing sets (test_size=0.3, random_state=42).
  3. Train a RandomForestClassifier with:
    • n_estimators=100,
    • max_depth=4,
    • random_state=42.
  4. Predict labels on the test set.
  5. Compute and print the accuracy score of your model.
  6. Store the trained model in a variable named rf_model and predictions in y_pred.

Рішення

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 2. Розділ 4
single

single

some-alt