Error when trying to run RandomForestClassifer with Pipieline and GridSearch I am trying to run a RandomForest Classifier using Pipeline, GridSerach and CV

I am getting an error when I fit the data. I am not sure how to fix it.

Will appreciate any help on this.

My code is:

 column_trans = make_column_transformer((OneHotEncoder(), ['CategoricalData']),
 remainder='passthrough')
 RF = RandomForestClassifier()
 pipe = make_pipeline(column_trans, RF)

 # Set grid search params
 grid_params = [{'RF__criterion': ['gini', 'entropy'],
 'RF__min_samples_leaf': [5,10,20,30,50,80,100],
 'RF__max_depth': [3,4,6,8,10],
 'RF_min_samples_split': [2,4,6,8,10]}]

 # Construct grid search
 gs = GridSearchCV(estimator = pipe,
 param_grid = grid_params,
 scoring='accuracy',
 cv=5)

 gs.fit(train_features, train_target)  ----This is where I get an error


 ValueError: Invalid parameter RF for estimator Pipeline(steps=[('columntransformer',
             ColumnTransformer(remainder='passthrough',
                               transformers=[('onehotencoder',
                                              OneHotEncoder(),
                                              ['CategoricalData'])])),
            ('randomforestclassifier', RandomForestClassifier())]). Check the list of available parameters with `estimator.get_params().keys()`.
In addition to adding a '_' I had to replace RF by randomforestclassifier in all grid params - Please see link below.
https://stackoverflow.com/a/62166539/9592484