0
$\begingroup$

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!

$\endgroup$
  • $\begingroup$ Can you share the code where are the less than or equal to comparison appears? $\endgroup$ – grldsndrs Jul 14 at 13:13
1
$\begingroup$

Your max iteration values are strings.

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

Try

max_iter': [200, 1000, 5000, 10000] }
$\endgroup$
  • $\begingroup$ Thanks so much!!! Such an elementary mistake on my part :( $\endgroup$ – Lasmyr Jul 15 at 1:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.