text_plain_output_1.png image_output_1.png
from sklearn.preprocessing import LabelEncoder

import pandas as pd

import pandas as pd

import seaborn as sns

import seaborn as sns

import seaborn as sns

import seaborn as sns

import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
train = pd.read_excel('/kaggle/input/products/ABBREV_with_CLASS.xlsx')
train

train.isnull().sum()

import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
data = train

Q1 = train['Protein_(g)'].quantile(0.25)
Q3 = train['Protein_(g)'].quantile(0.75)
IQR = Q3 - Q1
train = train[(train['Protein_(g)'] >= Q1 - 1.5 * IQR) & (train['Protein_(g)'] <= Q3 + 1.5 * IQR)]

import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
data = train

from sklearn.preprocessing import LabelEncoder
labelencoder_Shrt_Desc = LabelEncoder()
train['Shrt_Desc'] = labelencoder_Shrt_Desc.fit_transform(train['Shrt_Desc'])
labelencoder_GmWt_Desc1 = LabelEncoder()
train['GmWt_Desc1'] = labelencoder_GmWt_Desc1.fit_transform(train['GmWt_Desc1'])
labelencoder_GmWt_Desc2 = LabelEncoder()
train['GmWt_Desc2'] = labelencoder_GmWt_Desc2.fit_transform(train['GmWt_Desc2'])

train.isnull().sum()

import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()

centers = [[1, 1], [-1, -1]]
X = train.drop('CLASS', axis=1)
y = train['CLASS']

sns.scatterplot(x=X[:, 0], y=X[:, 1], hue=y)