建模与调参
赛题:零基础入门数据挖掘 - 二手车交易价格预测
地址:
https://tianchi.aliyun.com/competition/entrance/231784/introduction?spm=5176.12281957.1004.1.38b02448ausjSX
基于XGBoost与LightGBM的模型融合
在kaggle比赛中,XGBoost和LightGBM是两大利器,所以我只针对这两个模型进行建模与调参
基于LightGBM的模型的调参
from sklearn.model_selection import GridSearchCV
parameters = {'objective': objective , 'num_leaves': num_leaves, 'max_depth': max_depth}
model = LGBMRegressor()
clf = GridSearchCV(model, parameters, cv=5)
clf = clf.fit(train_X, train_y)
clf.best_params_
基于XGBoost模型的调参
import xgboost as xgb
parameters = {'objective': objective , 'num_leaves': num_leaves, 'max_depth': max_depth}
model = xgbr()
clf = GridSearchCV(model, parameters, cv=5)
clf = clf.fit(train_X, train_y)
clf.best_params_