パラメーターチューニングの設定の仕方はどのようにするのでしょうか?
pipe_logistic = Pipeline([('scl',StandardScaler()),('est',LogisticRegression(random_state=1))]) pipe_gbc = Pipeline([('scl',StandardScaler()),('est',GradientBoostingClassifier(random_state=1))]) param_grid_logistic = {'est__C':[0.1,1.0,10.0,100.0], 'est__penalty':['l1','l2']} param_grid_gbc = {'est__n_estimators':[50,100],'est__subsample':[0.8, 1.0]} pipes = [pipe_logistic, pipe_gbc] params = [param_grid_logistic, param_grid_gbc] best_estimator = [] for elem in zip(pipes, params): ・ ・ ・
というサンプルコードがありました。
param_grid_logistic = {'est__C':[0.1,1.0,10.0,100.0], 'est__penalty':['l1','l2']} param_grid_gbc = {'est__n_estimators':[50,100],'est__subsample':[0.8, 1.0]}
のコードで、'est__C'・'est__n_estimators'とキーを指定していますが、このキー名は自分で指定できるものなのでしょうか?また、[0.1,1.0,10.0,100.0]・[50,100]・['l1','l2']・[0.8, 1.0]の値も自分で指定できるものなのでしょうか?例えば、[0.1,1.0,10.0,100.0]の代わりに[1,2,3,4]と指定するなどのようにです。
回答1件
あなたの回答
tips
プレビュー