How to restrict the columns to be passed to final classifier in PMML Pipeline
After digging down too much and some help from sklearn2pmml creator, I
managed to filter the final columns to be passed to the classifier.
Note : Here recorder is DataFrameMapper object.

1.Getting categorical column indexes.
cat_cols = [recorder.transformed_names_.index(c) for c in categoricalCols if c in recorder.transformed_names_]

2.Adding ColumnTransformer to filter those column with the help of their indexes.
pipeline = PMMLPipeline([
    (&quot;mapper&quot;, recorder),
    (&quot;select&quot;, ColumnTransformer([(&quot;drop&quot;, &quot;drop&quot;, cat_cols)], remainder='passthrough')),
    (&quot;classifier&quot;, xgb.XGBClassifier())
])

3.Fitting the Data to the pipeline.
pipeline.fit(X_train,y_train)

4.Creating PMML file out of Pipeline.
out_file = &quot;XGBoost.pmml&quot;
sklearn2pmml(pipeline, out_file)