<jupyter_start><jupyter_text>WEEK - 8 ASSIGNMENTS Data Science & Data Analytics Laboratory Name: <NAME> Section: CSE 3H Roll No.: 29 Enrollment No.: 12018009019439  Multi Layer Perceptron<jupyter_code>from sklearn.datasets import load_iris
iris = load_iris()
import pandas as pd
data = pd.DataFrame(iris.data, columns=iris.feature_names)
data["species"] = pd.DataFrame(iris.target)
data.head()
X = data.iloc[:, :-1]
Y = data.iloc[:, -1]
from sklearn.neural_network import MLPClassifier

model = MLPClassifier(
    hidden_layer_sizes=(10,),
    max_iter=5000,
    activation='logistic',
    solver='sgd',
    learning_rate_init=0.001)
from sklearn.model_selection import cross_val_score
scores = cross_val_score(model, X, Y, cv=10)
print("Iteration\tAccuracy")
for idx, score in enumerate(scores):
    print("%d\t\t%0.2f"%(idx, score))
print("Average Accuracy: %0.2f"%scores.mean())
print("Standard deviation: %0.2f"%scores.std())<jupyter_output>Average Accuracy: 0.93
Standard deviation: 0.06
{'fraction_non_alphanumeric': 0.1350806451612903, 'fraction_numerical': 0.04435483870967742, 'mean_word_length': 5.895833333333333, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '402186', 'license': 'MIT', 'n_tokens_mistral': 401, 'n_tokens_neox': 360, 'n_words': 82, 'path': 'Week-8/Perceptron.ipynb', 'repo_name': 'ShruKin/Data-Science-Data-Analytics-Lab', 'size': '1004'}