I am trying to include a variable like "account number" which is an "ID" as a predictive variable for a logistic regression model. In fact there are several columns in my dataset that are "IDs" but are important in predicting the outcome. for example if an account number is associated with a fraudulent phone number, I want my model to capture this relationship. Transforming these variables to categorical variables is not a solution since the are over 20 millions of them in each column. I have done word embedding and transformed each ID to a vector space then applied PCA to reduce the size of the space and replaced every ID with a vector and an ID column to several columns which are now continues variables. However this idea fails when the number of IDs are over a million. I appreciate if you point out an example/study similar to my problem. and please let me know if I need to explain the problem in more details. I have used gensim library in python for word embedding and amazon ML to train and test the model.
Update: recently tensorflow developers added a new functionality called "hashing" and "embedding".