Hi guys I'm a new programmer so sorry if this is so simple error but I need help in this code
# Step 6: Hyperparameter Optimization
from skopt import gp_minimize
from skopt.space import Real, Integer
# Define hyperparameter search space
space = [
Real(0.001, 0.1, name='learning_rate'),
Integer(32, 128, name='batch_size'),
Integer(50, 150, name='lstm_units'),
Integer(1, 3, name='lstm_layers')
]
# Define objective function
def lstm_objective(params):
# Unpack hyperparameters
learning_rate = params[0]
batch_size = params[1]
lstm_units = params[2]
lstm_layers = params[3]
# Update LSTM model architecture
model = Sequential()
for i in range(lstm_layers):
model.add(LSTM(units=lstm_units, return_sequences=True))
model.add(Dense(1))
# Compile and fit
model.compile(optimizer=Adam(learning_rate), loss='mse')
model.fit(X_train, y_train, batch_size=batch_size, epochs=10)
# Evaluate MSE on validation set
mse = model.evaluate(X_val, y_val, verbose=0)
return mse
# Run optimization
best_params = gp_minimize(lstm_objective, space, n_calls=15, random_state=0)
print(best_params.x)
so after run i got strange error in line
best_params = gp_minimize(lstm_objective, space, n_calls=15, random_state=0)
AttributeError: module 'numpy' has no attribute 'int'.
np.intwas a deprecated alias for the builtinint. To avoid this error in existing code, useintby itself. Doing this will not modify any behavior and is safe. When replacingnp.int, you may wish to use e.g.np.int64ornp.int32to specify the precision. If you wish to review your current use, check the release note link for additional information. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
as you can see I don't have any kind of numpy in this code befor or even after this part but got this error any solution ?
I try install and uninstall and upgrade numpy but don't work