<jupyter_start><jupyter_text>Installing Scikit learnFor installing Scikit learn, go to command prompt (Win+R => cmd enter) pip install -U scikit-learnDocumentation - https://scikit-learn.org/stable/install.html ! conda install scikit-learn<jupyter_code>from sklearn.datasets import load_iris
iris = load_iris()<jupyter_output><empty_output><jupyter_text>This data sets consists of 3 different types of irises’ (Setosa, Versicolour, and Virginica) petal and sepal length, stored in a 150x4 numpy.ndarrayThe rows being the samples and the columns being: Sepal Length, Sepal Width, Petal Length and Petal Width.<jupyter_code>iris
X = iris.data[:, (2, 3)]  # petal length, petal width
iris.target<jupyter_output><empty_output><jupyter_text>Categories* 0 setosa* 1 versicolor* 2 virginica<jupyter_code>y = (iris.target == 0)
y
y = (iris.target == 0).astype(np.int)
y
X
from sklearn.linear_model import Perceptron<jupyter_output><empty_output><jupyter_text>Documentation : https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.Perceptron.html<jupyter_code>per_clf = Perceptron(random_state=42)
per_clf.fit(X, y)
y_pred = per_clf.predict(X)
y_pred
from sklearn.metrics import accuracy_score
accuracy_score(y, y_pred)
per_clf.coef_
per_clf.intercept_<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10162916989914662, 'fraction_numerical': 0.010861132660977503, 'mean_word_length': 7.1645569620253164, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 18, 'https://': 2, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '493243', 'license': 'MIT', 'n_tokens_mistral': 488, 'n_tokens_neox': 468, 'n_words': 107, 'path': 'estudos_python/Machine_Learning/Others/5. ST Academy - ANN resource files/Python_codes/Perceptron.ipynb', 'repo_name': 'robertoweller/python', 'size': '1289'}