Of course, here it is
numerical_columns_selector = selector(dtype_exclude=object)
categorical_columns_selector = selector(dtype_include=object)
numerical_columns = numerical_columns_selector(data)
categorical_columns = categorical_columns_selector(data)
preprocessor = make_column_transformer(
(OneHotEncoder(sparse=False,drop="if_binary", handle_unknown="ignore", dtype=np.int32), categorical_columns),
(StandardScaler(),numerical_columns),
verbose_feature_names_out=True,
)
model = make_pipeline(
preprocessor, LogisticRegression(max_iter=1000))
cv_results = cross_validate(model, data, target,
cv=10, scoring="accuracy",
return_train_score=True,
return_estimator=True)
and the solution I used :
coefs = [ ]
for est in cv_results["estimator"]:
if est[-1].coef_[0].shape[0]==105:
coefs.append(est[-1].coef_[0])