This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |