1

I'm making an MLP classifier for binomial classification from 145 features.

I want to get the best parameters on my MLP classifier to get a better prediction so I followed the answer to this question, which is to use gridsearchCV from sklearn. However, when I get to

clf.fit(DEAP_x_train, DEAP_y_train)

I get the ff error:

TypeError: '<=' not supported between instances of 'str' and 'int'

I checked my train data and both X and y have already been changed to become float data type, so I don't understand why I keep getting this response.

For reference, I have 145 features to predict a binary response, and this is my parameter_space:

parameter_space = {
    'hidden_layer_sizes': [(368,), (555,), (100,)],
    'activation': ['identity', 'logistic', 'relu'],
    'solver': ['sgd', 'adam'],
    'alpha': [0.0001, 0.05],
    'learning_rate': ['constant','adaptive'],
    'max_iter': ['200', '1000', '5000', '10000']
}

I've tried to search for other cases online that this error response is shown when trying to fit, but I haven't come across any.

Would appreciate any response. Thanks!

Lasmyr
  • 35
  • 3

1 Answers1

2

Your max iteration values are strings.

max_iter': ['200', '1000', '5000', '10000'] 

Try

max_iter': [200, 1000, 5000, 10000] }
grldsndrs
  • 567
  • 4
  • 11