Machine Learning, Data Science, Python, Classification.
test[‘Embarked’].map(means) Log transformation for Fare train[“Fare”] = train[“Fare”].apply(log1p) test[“Fare”] = test[“Fare”].apply(log1p) Convert numerical feature to categorical def num2cat(x): return str(x) train[‘Pclass_cat’] = train[‘Pclass’].apply(num2cat) test[‘Pclass_cat’] =