Created
September 6, 2020 09:30
-
-
Save jiahao87/0f1f48e2490769cc1a2b549cef3b5080 to your computer and use it in GitHub Desktop.
Vaex sample code to titanic dataset
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import vaex | |
import vaex.ml | |
# load titanic data | |
df_vaex = vaex.ml.datasets.load_titanic() | |
# perform train test split | |
df_train, df_test = df_vaex.ml.train_test_split(test_size=0.2) | |
# One-hot encode some features | |
encoder = vaex.ml.OneHotEncoder(features=['survived', 'sex', 'pclass']) | |
df_train = encoder.fit_transform(df_train) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment