text_html_output_1.png
from sklearn.model_selection import GridSearchCV

from sklearn.model_selection import train_test_split, cross_val_score

from sklearn.neural_network import MLPClassifier

from sklearn.preprocessing import MinMaxScaler

import pandas as pd

import pandas as pd
df = pd.read_csv('../input/adult-census-income/adult.csv')

low = '<=50K'
y = df['income'].apply(lambda x: 0 if x == low else 1)

X = df.drop(['income'], axis=1)

X = pd.get_dummies(X)

from sklearn.model_selection import train_test_split, cross_val_score
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=1)
from sklearn.preprocessing import MinMaxScaler
scaler = MinMaxScaler()
scaler.fit(X_train)
X_train = scaler.transform(X_train)
X_test = scaler.transform(X_test)

from sklearn.neural_network import MLPClassifier
clf = MLPClassifier(random_state=1, max_iter=3000)
parameter_grid = {'hidden_layer_sizes': [3, (3, 3)]}

from sklearn.model_selection import GridSearchCV
gs = GridSearchCV(clf, parameter_grid, cv=5)
gs = gs.fit(X_train, y_train)

clf_best = gs.best_estimator_
print('best model:', clf_best.get_params())
clf_best = clf_best.fit(X_train, y_train)