Data Transformation, Sklearn, Machine Learning, One Hot Encoding, Label Encoding.
compare all the categories with the output category (Survived). ##['sex','embarked','alone','pclass','Survived'] df=df[['sex','embarked','alone','pclass','survived']] df.head() Let’s perform label encoding on the embarked df['sex']=np.where(df['sex']=="male",1,0) df.head() Let’s perform label