Skip to content

Instantly share code, notes, and snippets.

@justxor
Created May 31, 2022 06:40
Show Gist options
  • Save justxor/34291813852d1c09c702a36be82d7adf to your computer and use it in GitHub Desktop.
Save justxor/34291813852d1c09c702a36be82d7adf to your computer and use it in GitHub Desktop.
from ml_performance_monitoring.monitor import wrap_model
import numpy as np
from sklearn.metrics import mean_squared_error
from sklearn.datasets import load_boston
from sklearn.model_selection import train_test_split
import xgboost as xgb
boston_dataset = load_boston()
X, y = (
boston_dataset["data"],
boston_dataset["target"],)
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.2, random_state=123
)
print(X_train[:5], y_train[:5])
xg_reg = xgb.XGBRegressor(
objective="reg:linear",
colsample_bytree=0.3,
learning_rate=0.1,
max_depth=5,
alpha=10,
n_estimators=10,
)
xg_reg.fit(X_train, y_train)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment