EL之GB(GBM):利用GB对回归(性别属性编码+调2参)问题(整数值年龄预测)建模

EL之GB(GBM):利用GB对回归(性别属性编码+调2参)问题(整数值年龄预测)建模


输出结果

T1、

T2、

设计思路

核心代码

#T1
nEst = 2000
depth = 5
learnRate = 0.003
maxFeatures = None
subsamp = 0.5

#T2
# nEst = 2000
# depth = 5
# learnRate = 0.005
# maxFeatures = 3
# subsamp = 0.5

abaloneGBMModel = ensemble.GradientBoostingRegressor(n_estimators=nEst, max_depth=depth,
                                                     learning_rate=learnRate, max_features=maxFeatures,
                                                     subsample=subsamp, loss='ls')

abaloneGBMModel.fit(xTrain, yTrain)

# compute mse on test set
msError = []
predictions = abaloneGBMModel._staged_decision_function(xTest)
for p in predictions:
    msError.append(mean_squared_error(yTest, p))
(0)

相关推荐