Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
Performs regression using XGBoost on synthetic data.
import xgboost as xgb
from sklearn.datasets import make_regression
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error
X,y = make_regression(n_samples=100,n_features=5,noise=0.1,random_state=42)
X_train,X_test,y_train,y_test = train_test_split(X,y,test_size=0.2,random_state=42)
model = xgb.XGBRegressor(objective='reg:squarederror')
model.fit(X_train,y_train)
y_pred = model.predict(X_test)
print('MSE:',mean_squared_error(y_test,y_pred))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.