text_plain_output_2.png application_vnd.jupyter.stderr_output_1.png
from sklearn import datasets

from sklearn.datasets import fetch_openml

from sklearn.datasets import fetch_openml

from sklearn.model_selection import train_test_split

from sklearn.model_selection import train_test_split

from sklearn.model_selection import train_test_split

from sklearn.model_selection import train_test_split

from sklearn.model_selection import train_test_split

from sklearn.model_selection import train_test_split

from sklearn.neural_network import MLPClassifier

from sklearn.neural_network import MLPClassifier

from sklearn.neural_network import MLPClassifier

from sklearn.neural_network import MLPClassifier

from sklearn.preprocessing import MinMaxScaler

from sklearn.preprocessing import MinMaxScaler

from sklearn.preprocessing import StandardScaler

import matplotlib.pyplot as plt

import matplotlib.pyplot as plt

import numpy as np

from sklearn import datasets
from sklearn.datasets import fetch_openml
import matplotlib.pyplot as plt
digits = datasets.load_digits()

X, y = datasets.load_digits(return_X_y=True)

clf = MLPClassifier(random_state=1)
clf.fit(X_train, y_train)
clf.score(X_test, y_test)

clf = MLPClassifier(random_state=1)
clf.fit(X2_train, y2_train)
clf.score(X2_test, y2_test)

scaler = StandardScaler()
scaler.fit(X_train)
X_train = scaler.transform(X_train)
X_test = scaler.transform(X_test)

clf = MLPClassifier(random_state=1)
clf.fit(X_train, y_train)
clf.score(X_test, y_test)

scaler = StandardScaler()
scaler.fit(X2_train)
X2_train = scaler.transform(X2_train)
X2_test = scaler.transform(X2_test)

clf = MLPClassifier(random_state=1)
clf.fit(X2_train, y2_train)
clf.score(X2_test, y2_test)

import seaborn as sns
from sklearn.preprocessing import MinMaxScaler
scaler_mm = MinMaxScaler()
X_train = scaler_mm.fit_transform(X_train)
X_test = scaler_mm.transform(X_test)

from sklearn.datasets import load_digits
from sklearn.model_selection import train_test_split
from sklearn.neural_network import MLPClassifier
from sklearn.metrics import accuracy_score
X, y = datasets.load_digits(return_X_y=True)
y_binary = [1 if val % 2 != 0 else 0 for val in y]
X_train, X_test, y_train, y_test = train_test_split(X, y_binary, test_size=0.2, random_state=42)
clf = MLPClassifier(random_state=1)
clf.fit(X_train, y_train)
clf.score(X_test, y_test)

from sklearn.datasets import load_digits
from sklearn.datasets import fetch_openml
from sklearn.model_selection import train_test_split
from sklearn.neural_network import MLPClassifier
from sklearn.metrics import accuracy_score
import numpy as np
X, y = fetch_openml('mnist_784', version=1, return_X_y=True, as_frame=False)
y = y.astype(np.uint8)
y_binary = [1 if val % 2 != 0 else 0 for val in y]
X_train, X_test, y_train, y_test = train_test_split(X, y_binary, test_size=0.2, random_state=42)
clf = MLPClassifier(random_state=1)
clf.fit(X_train, y_train)
clf.score(X_test, y_test)

from sklearn.datasets import load_digits
from sklearn.model_selection import train_test_split
from sklearn.neural_network import MLPClassifier
from sklearn.metrics import accuracy_score
X, y = datasets.load_digits(return_X_y=True)
y_binary = [1 if i == 0 else 0 for i in y]
X_train, X_test, y_train, y_test = train_test_split(X, y_binary, test_size=0.2, random_state=42)
clf = MLPClassifier(random_state=1)
clf.fit(X_train, y_train)
clf.score(X_test, y_test)