Skip to content

Instantly share code, notes, and snippets.

@jiahao87
Created September 6, 2020 09:30
Show Gist options
  • Save jiahao87/0f1f48e2490769cc1a2b549cef3b5080 to your computer and use it in GitHub Desktop.
Save jiahao87/0f1f48e2490769cc1a2b549cef3b5080 to your computer and use it in GitHub Desktop.
Vaex sample code to titanic dataset
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