Scikit Learn DecisionTreeRegressor 算法不一致

发布于 2025-01-17 04:10:40 字数 142 浏览 2 评论 0原文

我目前正在使用决策树(使用 Scikit Learn DecisionTreeRegressor)来拟合回归树。我面临的问题是,使用与 6 个月前相同的数据的算法,输出(即最佳分割点)略有变化。我的猜测是,他们计算 mse 标准或类似标准的方式可能略有改变。有人知道吗?

I am currently using decision trees (using Scikit Learn DecisionTreeRegressor) to fit Regression tree. The problem I'm facing is that using the algorithm with same data as 6 months ago there is a slight change in output (ie. the optimal split point). My guess is that it could be that they have changed slightly the way they compute the mse criterion or something like that. Anybody knows?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

意犹 2025-01-24 04:10:40

DecisionTreeRegressor 表现出随机行为,除非您指定 random_state 作为构造函数的参数。

random_state 的详细信息>文档解释了随机性可能影响你的执行的地方 - 特别参见我突出显示的粗体部分:

random_state int,RandomState 实例或 None,默认=None

控制估计器的随机性。即使拆分器设置为“最佳”,特征在每次拆分时始终会随机排列。当 max_features n_features,算法将在每次分割时随机选择 max_features,然后找到其中的最佳分割。但即使 max_features=n_features,找到的最佳分割也可能因不同的运行而异。如果标准的改进对于多个分割是相同的并且必须随机选择一个分割,则情况就是这样。 为了在拟合期间获得确定性行为,random_state 必须固定为整数。有关详细信息,请参阅术语表。

DecisionTreeRegressor exhibits random behavior unless you specify a random_state as an argument of the constructor.

The details of random_state from the documentation explains the spots where randomness might affect your execution - see specially the bold part I highlighted:

random_state int, RandomState instance or None, default=None

Controls the randomness of the estimator. The features are always randomly permuted at each split, even if splitter is set to "best". When max_features < n_features, the algorithm will select max_features at random at each split before finding the best split among them. But the best found split may vary across different runs, even if max_features=n_features. That is the case, if the improvement of the criterion is identical for several splits and one split has to be selected at random. To obtain a deterministic behaviour during fitting, random_state has to be fixed to an integer. See Glossary for details.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文