We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
您好,在/code/chapter7.py中,第695行-699行
def _gain(self, y, y_pred): # 计算信息 nominator = np.power((y * self.loss.grad(y, y_pred)).sum(), 2) denominator = self.loss.hess(y, y_pred).sum() return nominator / (denominator + self.lambd)
def _gain(self, y, y_pred):
# 计算信息
nominator = np.power((y * self.loss.grad(y, y_pred)).sum(), 2)
denominator = self.loss.hess(y, y_pred).sum()
return nominator / (denominator + self.lambd)
其中np.power((y*.......),这个乘以y是否是多余的呢?印象中似乎不需要这么做。
此外,我自己实现的xgboost和另外两个xgboost的开源实现都没有这个乘以y。
以下是三个xgboost实现的链接。
https://github.com/bufuchangfeng/DecisionTree/blob/master/XGBoost.ipynb https://github.com/RRdmlearning/Machine-Learning-From-Scratch/blob/master/xgboost/xgboost_model.py https://github.com/RudreshVeerkhare/CustomXGBoost/blob/master/CustomXGBoost.py
感谢您提供了如此有帮助的代码。 期待您的回复。
The text was updated successfully, but these errors were encountered:
谢谢你的纠错,抱歉没有及时回复你的问题。
Sorry, something went wrong.
No branches or pull requests
您好,在/code/chapter7.py中,第695行-699行
def _gain(self, y, y_pred):
# 计算信息
nominator = np.power((y * self.loss.grad(y, y_pred)).sum(), 2)
denominator = self.loss.hess(y, y_pred).sum()
return nominator / (denominator + self.lambd)
其中np.power((y*.......),这个乘以y是否是多余的呢?印象中似乎不需要这么做。
此外,我自己实现的xgboost和另外两个xgboost的开源实现都没有这个乘以y。
以下是三个xgboost实现的链接。
https://github.com/bufuchangfeng/DecisionTree/blob/master/XGBoost.ipynb
https://github.com/RRdmlearning/Machine-Learning-From-Scratch/blob/master/xgboost/xgboost_model.py
https://github.com/RudreshVeerkhare/CustomXGBoost/blob/master/CustomXGBoost.py
感谢您提供了如此有帮助的代码。
期待您的回复。
The text was updated successfully, but these errors were encountered: