on-internet
← Community

Pandas: Partial dependence plots + One hot encoding

Stack Overflow ·

I am currently working through this tutorial. What I am currently trying to display is how 'survival' was influenced by gender (Sex in the dataset). As that is category data I must first transform that data. I tried it with one hot encoding, but that doesn't seem to be the right approach. titanic_data = pd.read_csv('../input/titanic/train.csv') titanic_y = titanic_data.Survived clf = GradientBoostingClassifier() titanic_sex = titanic_data.Sex one_hot_encoded_training_predictors = pd.get_dummies(titanic_sex) titanic_X_colns = ['PassengerId','Age', 'Fare', one_hot_encoded_training_predictors] ti

Comments

Sign in or sign up to comment and upvote.

No comments yet.