import neptune.new as neptune
from neptune.new.integrations.xgboost import NeptuneCallback
from sklearn.datasets import load_boston
from sklearn.model_selection import train_test_split
project="common/xgboost-integration",
tags=["xgb-integration", "train"],
# Create neptune callback
neptune_callback = NeptuneCallback(run=run, log_tree=[0, 1, 2, 3])
X, y = load_boston(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(
dtrain = xgb.DMatrix(X_train, label=y_train)
dval = xgb.DMatrix(X_test, label=y_test)
"objective": "reg:squarederror",
"eval_metric": ["mae", "rmse"]
evals = [(dtrain, "train"), (dval, "valid")]
# Train the model and log metadata to the run in Neptune
num_boost_round=num_round,
xgb.callback.LearningRateScheduler(lambda epoch: 0.99**epoch),
xgb.callback.EarlyStopping(rounds=30)