Aml Lab 41 Ann Hyperparameter Tuning - Ipynb - Colab
Aml Lab 41 Ann Hyperparameter Tuning - Ipynb - Colab
ipynb - Colab
df = pd.read_csv("/content/data.csv")
df.head()
5 rows × 33 columns
y = df.diagnosis.values.reshape(-1,1)
x = df.iloc[:,1:].values
grid_search.fit(x_train, y_train)
Increase the number of iterations (max_iter) or scale the data as shown in:
https://scikit-learn.org/stable/modules/preprocessing.html
self.n_iter_ = _check_optimize_result("lbfgs", opt_res, self.max_iter)
▸ GridSearchCV
▸ estimator: MLPClassifier
▸ MLPClassifier
https://colab.research.google.com/drive/1cLCGou51IYt9euhPGF4iVEqruH5Fx3KB?authuser=1#printMode=true 1/3
7/3/24, 9:45 AM AML_LAB_41_ANN_HYPERPARAMETER_TUNING.ipynb - Colab
print(f'Best estimator: {grid_search.best_estimator_}')
print(f'Best parameters: {grid_search.best_params_}')
Increase the number of iterations (max_iter) or scale the data as shown in:
https://scikit-learn.org/stable/modules/preprocessing.html
self.n_iter_ = _check_optimize_result("lbfgs", opt_res, self.max_iter)
▸ GridSearchCV
▸ estimator: MLPClassifier
▸ MLPClassifier
y_pred=grid_search.predict(x_test)
Accuracy: 95.61%
https://colab.research.google.com/drive/1cLCGou51IYt9euhPGF4iVEqruH5Fx3KB?authuser=1#printMode=true 2/3
7/3/24, 9:45 AM AML_LAB_41_ANN_HYPERPARAMETER_TUNING.ipynb - Colab
https://colab.research.google.com/drive/1cLCGou51IYt9euhPGF4iVEqruH5Fx3KB?authuser=1#printMode=true 3/3