<h3 dir="auto">Describe the workflow you want to enable</h3>
<p dir="auto">I want to use a pipleine that includes</p>
<ul dir="auto">
<li>a feature selection step (like SelectKBest)</li>
<li>a HistGradientBoostingEstimator with monotonicity and/or categorical features</li>
</ul>
<p dir="auto">The problem is that specifying the features for this requires indices or a boolean mask, but the feature selection means the mask/indices will be off.</p>
<p dir="auto">You can do this with a custom class/FunctionTransformer, and you can do it without a pipeline, but it would be nicer to have it in a pipeline.</p>
<h3 dir="auto">Describe your proposed solution</h3>
<p dir="auto">Allow specifying categorical features or monotonicity constraints via feature names.</p>
<h3 dir="auto">Describe alternatives you've considered, if relevant</h3>
<ul dir="auto">
<li>A custom class</li>
<li>Not using a pipeline</li>
</ul>
<h3 dir="auto">Additional context</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Describe the workflow you want to enable</h3>
<p dir="auto">As of current version, we need to specify monotonicity constraints for each feature as an array-like object ( e.g. [0,1,1] ) in HistGradientBoostingClassifier/Regressor. It would be a good quality of life improvement if we can specify the constraint as dict (e.g. {"feature_name1":0, "feature_name2":1 ...})  if the input X is a dataframe.</p>
<p dir="auto">References:</p>
<ul dir="auto">
<li><a href="https://scikit-learn.org/stable/modules/ensemble.html#monotonic-cst-gbdt" rel="nofollow">https://scikit-learn.org/stable/modules/ensemble.html#monotonic-cst-gbdt</a></li>
<li><a href="https://scikit-learn.org/stable/auto_examples/ensemble/plot_monotonic_constraints.html" rel="nofollow">https://scikit-learn.org/stable/auto_examples/ensemble/plot_monotonic_constraints.html</a></li>
<li><a href="https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.HistGradientBoostingClassifier.html#sklearn.ensemble.HistGradientBoostingClassifier" rel="nofollow">https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.HistGradientBoostingClassifier.html#sklearn.ensemble.HistGradientBoostingClassifier</a></li>
</ul>
<h3 dir="auto">Describe your proposed solution</h3>
<p dir="auto">Make the following changes inside fit function for HistGradientBoostingClassifier/Regressor:</p>
<ul dir="auto">
<li>Change input type for monotonic_cst to array-like or dict.</li>
<li>If constraint is specified as a dict, add a validation check for verifying if X is a dataframe with string column names.</li>
<li>Iterate through column names in X, add constraint if specified in the dict to array-like object or add default value if no constraint is specified explicitly. Return array-like object in place of original dict.</li>
</ul>
<h3 dir="auto">Describe alternatives you've considered, if relevant</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Additional context</h3>
<p dir="auto"><em>No response</em></p>