我一直认为机器学习结果有所不同,因为数据每次都会预先随机洗牌,从而导致不同的训练集。因此,当没有随机播放时,每次的结果应该是相同的。与 sklearn.linear_model.LinearRegression() 的情况一样,但 sklearn.linear_model.RANSACRegressor() 会显示不同的结果,即使它以相同的方式输入相同的训练数据每次都订购。这不就是一个数学函数吗,每次的结果不应该是一样的吗?有人可以解释一下吗,或者我的代码是否有错误,我是否错误地向其提供了不同的数据?
最佳答案
根据documentation ,数据是随机选择的。
一些参数中有指示,例如random_state:
random_state : int, RandomState instance or None, optional, default
None
The generator used to initialize the centers. If int, random_state is the seed used by the random number generator; If RandomState instance, random_state is the random number generator; If None, the random number generator is the RandomState instance used by np.random.
关于python - 为什么 RANSAC 回归器结果的变化与输入无关?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46024967/