我认为,权重应该随着随机状态的不同而略有变化。 随机_state=None时,每次跑步时获得不同权重的原因是什么
以下是几次运行的权重值(包含3个功能) 1)4.67100318,1.26129186,17.26554955 2)3.39793468,2.10265234,18.42484435 3)-2.08082186,1.25948975,10.37120852 4) 3.71122156,0.93510126,16.63007864
由于这种波动,我不确定应该使用哪种随机_状态,这在执行特征选择时造成了麻烦。 请注意,我是在执行标准化后使用数据的
我使用下面非常简单的代码来训练我的模型,因为我的数据只包含200行数据和3个特性
from sklearn.linear_model import SGDClassifier
SGDClf = SGDClassifier(loss='log',random_state=1)
SGDClf.fit(X,Y)
Machine learning models will produce different results on same dataset,
random_state = None
,模型生成一个称为random seed的随机数序列,用于从给定数据集生成测试、验证和训练数据集的过程,例如:
random_state = 1
。将模型种子配置为设定值将确保(权重)结果可重复。
SGDClassifier()洗牌输入的数据:
希望对你有帮助
相关问题 更多 >
编程相关推荐