<jupyter_start><jupyter_text>***LetsGrowMore***  **Task-1 :- Iris Flower Classification ML Project** **AUTHOR :- <NAME>**  **Importing required libraries**<jupyter_code>import numpy as np
import matplotlib.pyplot as plt<jupyter_output><empty_output><jupyter_text>**Loading dataset**<jupyter_code>from sklearn.datasets import load_iris
dataset = load_iris()
print(dataset.DESCR)
X = dataset.data
y = dataset.target
y
X<jupyter_output><empty_output><jupyter_text>**Data Visualization**<jupyter_code>plt.plot(X[:, 0][y == 0] * X[:, 1][y == 0], X[:, 2][y == 0] * X[:, 3][y == 0], 'r.', label="Satosa")
plt.plot(X[:, 0][y == 1] * X[:, 1][y == 1], X[:, 2][y == 1] * X[:, 3][y == 1], 'g.', label="Virginica")
plt.plot(X[:, 0][y == 2] * X[:, 1][y == 2], X[:, 2][y == 2] * X[:, 3][y == 2], 'b.', label="Versicolour")
plt.legend()
plt.show()
from sklearn.preprocessing import StandardScaler
X = StandardScaler().fit_transform(X)<jupyter_output><empty_output><jupyter_text>**Splitting the data for training and testing**<jupyter_code>from sklearn.model_selection import train_test_split

X_train, X_test, y_train, y_test = train_test_split(X, y)<jupyter_output><empty_output><jupyter_text>**Logistic Regression**<jupyter_code>from sklearn.linear_model import LogisticRegression
log_reg = LogisticRegression()<jupyter_output><empty_output><jupyter_text><jupyter_code>log_reg.fit(X_train, y_train)
log_reg.score(X_test, y_test)
log_reg.score(X, y)<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup