为什么这个参数在sklearn的管道中无效?

2024-05-12 22:26:41 发布

您现在位置:Python中文网/ 问答频道 /正文

我得到以下代码的以下错误,但无法找出我的参数无效的原因。SelectFromModel是管道中的有效输入,因为它具有fit和transform函数。在

ValueError: Invalid parameter sfm_threshold for estimator Pipeline.
Check the list of available parameters with
`estimator.get_params().keys()`

^{pr2}$

当我运行pipe_lr.get_params().keys()时,我得到了以下输出,它实际上包括sfm__threshold,我复制并粘贴了它。在

 ['std__with_mean',
 'sfm__estimator__precompute',
 'lr__n_jobs',
 'sfm__prefit',
 'poly',
 'sfm__threshold',
 'sfm__estimator__cv',
 'sfm__estimator__max_iter',
 'sfm__estimator__positive',
 'sfm__estimator__n_alphas',
 'std__with_std',
 'sfm__estimator__random_state',
 'std__copy',
 'lr__normalize',
 'sfm__estimator__copy_X',
 'lr',
 'sfm__estimator__n_jobs',
 'poly__interaction_only',
 'sfm__estimator__fit_intercept',
 'sfm__estimator__tol',
 'sfm__estimator',
 'sfm__estimator__verbose',
 'sfm',
 'sfm__estimator__normalize',
 'std',
 'sfm__estimator__selection',
 'poly__degree',
 'lr__copy_X',
 'sfm__estimator__alphas',
 'lr__fit_intercept',
 'steps',
 'poly__include_bias',
 'sfm__estimator__eps']

Tags: getthresholdwithjobsparamskeysfitstd