Adaboost提升方法:GBDT实现
import numpy as np
class myAdaboost():
def __init__(self,train_X,train_y,numIter):
self.train_X=np.asarray(train_X)
self.train_y=np.asarray(train_y).reshape(-1,1)
self.numIter=numIter
self.weakClassArr = []
def stumpClassify(self, dataMatrix, dimen, threshVal, threshIneq):
dataMatrix = np.asarray(dataMatrix)
retArray = np.ones((dataMatrix.shape[0], 1))
if threshIneq == 'lt':
retArray[
版权声明:
作者:lichengxin
链接:https://www.techfm.club/p/26231.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。
THE END
二维码
共有 0 条评论