Skip to content

Instantly share code, notes, and snippets.

View luminousmen's full-sized avatar

Kirill luminousmen

View GitHub Profile
import optuna
import xgboost as xgb
from sklearn.metrics import mean_squared_error # or any other metric
from sklearn.model_selection import train_test_split
# Load the dataset
X, y = ... # load your own
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
# Define the objective function for Optuna