Complete the code to import the XGBoost classifier.
from xgboost import [1]
The XGBClassifier is the class used for classification tasks in XGBoost.
Complete the code to create an XGBoost classifier with 100 trees.
model = XGBClassifier(n_estimators=[1])The n_estimators parameter sets the number of trees. 100 is a common choice.
Fix the error in the code to train the model on features X and labels y.
model.fit([1], y)The fit method requires the feature data X as the first argument.
Fill both blanks to predict labels and calculate accuracy score.
preds = model.[1](X_test) accuracy = [2](y_test, preds)
Use predict to get predictions and accuracy_score to measure accuracy.
Fill all three blanks to create a dictionary of feature importances for features in feature_names.
importances = { [1]: model.feature_importances_[i] for i, [2] in enumerate([3]) }Use name as the key, feature as the loop variable, and feature_names as the list of features.
