import lightgbm as lgb
import numpy as np
from datetime import datetime
from sklearn.datasets import make_regression
X, y = make_regression(n_samples=1000000, n_features=40, n_informative=20, random_state=42)
print(f'训练开始: {datetime.now()}')
train_data = lgb.Dataset(X, label=y)
params = {
    "objective": "regression",
    "metric": "mse",
    "device": "cuda",
    "num_threads": -1,
    "verbosity": 1,
    "max_depth": 6,
    "learning_rate": 0.05
}
model = lgb.train(params, train_data, num_boost_round=500)
print(f'训练结束: {datetime.now()}')
