[英]Group argument in fit method - sklearn
I'm trying to run a cross validation with grouped data in Sklearn when I found that the fit
method当我发现fit
方法时,我正在尝试对 Sklearn 中的分组数据进行交叉验证
fit(X, y=None, groups=None, **fit_params)
has a groups argument defined as:有一个 groups 参数定义为:
groups: array-like, with shape (n_samples,), optional Group labels for the samples used while splitting the dataset into train/test set. groups:类似数组,形状为 (n_samples,),可选 Group labels for the samples used while splitting the dataset into train/test set.
Is this the same thing as spliting my data with other iterators for grouped data ( GroupKFold
, LeaveOneGroupOut
)?这与将我的数据与分组数据的其他迭代器( GroupKFold
、 LeaveOneGroupOut
)拆分是一回事吗? If not, what is the proper way to run GridSeachCV
with grouped data?如果不是,使用分组数据运行GridSeachCV
的正确方法是什么?
Yes, they are same.是的,他们是一样的。
Please refer to the documentation of GridsearchCV fit()
:请参考GridsearchCV fit()
的文档:
groups: array-like, with shape (n_samples,), optional groups: array-like, with shape (n_samples,), 可选
Group labels for the samples used while splitting the dataset into train/test set.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.