New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using sklearn-genetic with neural networks #22
Comments
My pipeline would be as follows:
I can get your code running and have also been able to count the number of selected features with:
but I don't know how to feed that number into my pipeline and model. |
Sorry for the late reply. Did you try to use the delayed-build pattern (no input shape specified) with keras? See https://www.tensorflow.org/api_docs/python/tf/keras/Sequential#examples_3 |
Hi - I did not, I proceeded with scikit-learn's MLPClassifier and MLPRegressor. Lesson learned, thanks for pointing that out. |
Hi @manuel-calzolari
I am looking to use sklearn-genetic with a neural network, currently attempting to use with Keras NNs, although I am not necessarily tied to Keras.
I get the following error:
ValueError: Input 0 of layer sequential_2086 is incompatible with the layer: expected axis -1 of input shape to have value 180 but received input with shape (None, 118)
I understand why this is occurring - my NN input layer is expecting 180 features. Is there some way I can provide the number of features that sklearn-genetic is attempting to train with?
My KerasClassifier is defined as:
estimator = KerasClassifier(lambda: create_nn_model(features=num_features), epochs=100)
so I can dynamically supply this.Can you suggest how I might use sklearn-genetic to select features for use in a NN?
Thanks for any help you can give.
The text was updated successfully, but these errors were encountered: