Create a pipeline for recursive eliminartion using artifical neural nets

I am trying to use RFE with Artificial neural nets but I am getting the error that 'Sequential' object has no attribute '_get_tags' . Here is my code snippet. Any help would be appreciated.

model_2 = Sequential([
    Dense(9, activation='linear'),                  
    Dense(200, activation=tf.keras.layers.LeakyReLU(alpha=0.3)), 
    Dense(1, activation='linear'),                                  
])

adam = keras.optimizers.Adam(lr=0.0001, beta_1=0.9, beta_2=0.999,epsilon=None, decay=0.0, amsgrad=False) 
model_2.compile(optimizer=adam,loss='mse',metrics=['accuracy'])

rfe = RFE(model_2, n_features_to_select=5)
pipeline = Pipeline(steps=[('s',rfe),('m',model_2)])

hist_2 = pipeline.fit(X2_train.iloc[:,10:20].values,     y2_train.iloc[:,1].to_numpy(),
    m__batch_size=10, m__epochs=4000,
    m__validation_data=(X2_test.iloc[:,10:20].values, y2_test.iloc[:,1]))

Topic rfe ann pipelines

Category Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.