Last active
March 26, 2018 14:18
-
-
Save dkn22/cab41c912e15e1339e20807326591dce to your computer and use it in GitHub Desktop.
embed rossman data
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 pandas as pd | |
from embedder.regression import Embedder | |
from embedder.preprocessing import (categorize, | |
pick_emb_dim, encode_categorical) | |
rossman = pd.read_csv('rossman.csv') | |
y = rossman['Sales'] | |
X = rossman.drop('Sales', axis=1) | |
cat_vars = categorize(rossman) | |
embedding_dict = pick_emb_dim(cat_vars, max_dim=50) | |
X_encoded, encoders = encode_categorical(X) | |
embedder = Embedder(embedding_dict, model_json=None) | |
embedder.fit(X_encoded, y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment