1

could someone please help me to fix the following error :

[AttributeError: 'super' object has no attribute 'sklearn_tags']

based on my code :

from tensorflow import keras 
from scikeras.wrappers import KerasRegressor
def build_model():
    model = keras.Sequential([
        keras.layers.Dense(32, activation = 'tanh', input_shape = [len(X.keys())]),
        keras.layers.Dense(16, activation = 'tanh'),
        keras.layers.Dense(1, activation = "sigmoid")])
    optimizer = keras.optimizers.RMSprop()
    model.compile(loss = keras.losses.BinaryCrossentropy(),
                  optimizer = optimizer,
                  metrics = [keras.metrics.BinaryAccuracy()])
    return model
kr = KerasRegressor(build_model, epochs=100, batch_size=10000,verbose=1)
kr.fit(X_train,y_train, validation_split = 0.2)

I'm looking everywhere to find a solution but nothing works until now ... Thanks

2
  • Could you provide the full code? Commented Apr 11 at 14:02
  • always put full error message because there are other useful information. Commented Apr 11 at 15:32

1 Answer 1

1

There is an sklearn issue. In sklearn 1.6.1 the error was turned into warning. You can install sklearn >=1.6.1,<1.7 and just expect DeprecationWarning regarding this issue.

Or another way, you can downgrade to 1.3.1 to avoid this issue

!pip uninstall -y scikit-learn
!pip install scikit-learn==1.3.1
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.