Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
Trains a model and prints feature importances.
import xgboost as xgb
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
data = load_breast_cancer()
X_train,X_test,y_train,y_test = train_test_split(data.data,data.target,test_size=0.2,random_state=42)
model = xgb.XGBClassifier(eval_metric='logloss')
model.fit(X_train,y_train)
print('Feature Importances:',model.feature_importances_)XGBoost (Extreme Gradient Boosting) is an optimized, scalable, and high-performance gradient boosting framework based on decision trees, widely used for supervised learning tasks including classification, regression, and ranking.
Origin & Creator
XGBoost was developed by Tianqi Chen and collaborators in 2014 to provide an efficient and scalable gradient boosting library, optimized for performance and accuracy.
Industrial Note
XGBoost is heavily used in Kaggle competitions, finance, healthcare analytics, adtech, recommendation systems, and any scenario needing fast and accurate tree-based predictions.