2

モデルのバッチを評価するために、tidymodels で workflow_set() 関数を使用しようとしています。検索範囲を変更するために一部のモデル仕様を変更できることを理解しました。たとえば、次の仕様が与えられます。

spec_lin <- linear_reg( penalty = tune(), 
                    mixture = tune()  ) %>%
set_engine('glmnet')

次を使用して範囲を変更できます。

rec_base <- recipe( price ~ feat_1) %>% 
  step_novel(feat_1) %>% 
  step_other(feat_1,threshold=.2 ) %>%
  step_dummy(feat_1)

rec_adv_param <- rec_base %>% 
  parameters() %>% 
  update ( mixture = mixture(c(0.1,0.01)) )

私の試みは同じことをすることですが、レシピのパラメーターを使用します。例えば:

rec_tuned <- recipe( price ~ feat_1) %>% 
  step_novel(feat_1) %>% 
  step_other(feat_1,threshold=tune() ) %>%
  step_dummy(feat_1)

に続く

rec_adv_param <- rec_tuned %>% 
  parameters() %>% 
  update ( threshold = threshold(c(0.1,0.2)) )

ただし、次のようなものを使用すると、workflow_set()定義で使用しようとすると

wf_set  <- workflow_set(recipes, models, cross = TRUE ) 
  option_add(param_info = rec_adv_param, id = "rec_tuned_spec_lin") 

フィナーレ "wf_set" は元のチューニング パラメータを失い、

threshold = threshold(c(0.1,0.2)

すべての workflow_set モデルでレシピのパラメーター仕様を追加する方法はありますか?

ありがとう

4

1 に答える 1