Challenge: Random Forest
Завдання
Swipe to start coding
Train and evaluate a Random Forest Classifier on the Iris dataset. Your task is to:
- Load the dataset using
sklearn.datasets.load_iris(). - Split the data into training and testing sets (
test_size=0.3,random_state=42). - Train a RandomForestClassifier with:
n_estimators=100,max_depth=4,random_state=42.
- Predict labels on the test set.
- Compute and print the accuracy score of your model.
- Store the trained model in a variable named
rf_modeland predictions iny_pred.
Рішення
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 2. Розділ 4
single
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат
Suggested prompts:
Can you explain this in simpler terms?
What are the main points I should remember?
Can you give me an example?
Чудово!
Completion показник покращився до 7.14
Challenge: Random Forest
Свайпніть щоб показати меню
Завдання
Swipe to start coding
Train and evaluate a Random Forest Classifier on the Iris dataset. Your task is to:
- Load the dataset using
sklearn.datasets.load_iris(). - Split the data into training and testing sets (
test_size=0.3,random_state=42). - Train a RandomForestClassifier with:
n_estimators=100,max_depth=4,random_state=42.
- Predict labels on the test set.
- Compute and print the accuracy score of your model.
- Store the trained model in a variable named
rf_modeland predictions iny_pred.
Рішення
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 2. Розділ 4
single