<jupyter_start><jupyter_text>changing data set leads --> seaborn dataset<jupyter_code>import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
df = sns.load_dataset("iris")
df.head()

x = df.iloc[: , :-1]
y = df.iloc[: , -1]
plt.xlabel('Features')
plt.ylabel('Species')
pltx =  df.iloc[: , 1]
plty = df.iloc[:, -1]
plt.scatter(pltx,plty, color='red', Label='SepalLength' )
pltx =  df.iloc[: , 2]
plty = df.iloc[:, -1]
plt.scatter(pltx,plty, color='green', Label='SepalWidth')
pltx =  df.iloc[: , 3]
plty = df.iloc[:, -1]
plt.scatter(pltx,plty, color='blue', Label='PetalLength')
pltx =  df.iloc[: , 4]
plty = df.iloc[:, -1]
plt.scatter(pltx,plty, color='black', Label='PetalWidth')
plt.legend(loc=4, prop={'size':8})
plt.show()
df["species"].value_counts()
df.plot(kind='scatter', x='sepal_length', y='sepal_width', grid=True)
plt.show()
import seaborn as sns
sns.relplot(x="sepal_length", y="sepal_width", hue="species" ,data = df)<jupyter_output><empty_output><jupyter_text>linearly seprable<jupyter_code>from sklearn.model_selection import train_test_split
x_train, x_test, y_train, y_test = train_test_split(x,y,test_size= 0.25, random_state = 42)
from sklearn.preprocessing import LabelEncoder 
  
le = LabelEncoder() 
df['sps'] = df["species"]  
df['sps']= le.fit_transform(df['sps']) 
from sklearn.linear_model import LogisticRegression
model = LogisticRegression()
model.fit(x_train, y_train)
predictions = model.predict(x_test)
print(predictions)    
from sklearn.metrics import classification_report
print(classification_report(y_test, predictions))
from sklearn.metrics import accuracy_score
print(accuracy_score(y_test, predictions))
model.score(x_train, y_train)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16082711085582999, 'fraction_numerical': 0.009764503159103963, 'mean_word_length': 6.954337899543379, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 10, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '410710', 'license': 'MIT', 'n_tokens_mistral': 697, 'n_tokens_neox': 674, 'n_words': 133, 'path': 'Logistic_IRIS_dataset_overfitting_correction.ipynb', 'repo_name': 'Lakshaypahuja21/Miny_Project-IRIS_dataset', 'size': '1741'}