Encoding ID variables for machine learning Is it possible to encode ID variables for an ML model in a way that the model can work with IDs not seen before?
For example, I want to predict the sentiment of a tweet, the account it may be originating from, and directed to, may help the classifier a lot to decide whether classify it as negative or positive.
Hence, is it possible to pass these features to the model in a way that, if a known id (shown whilst training) appears, it can help the prediction, and if there's a new id (unseen whilst training), the model can still work with it; either by no having impact whatsoever or by weighting the fact that it is an unrecognized id? If so, how would a Python + Sklearn implementation look like?

That's one of the important things in Data Science : you have to create your variables, good enough so your model can predict well.
Here, you pointed well, that you can't directly use IDs, but with profiles information, you can create variables that will reflect what you see as a human when you analyze the tweet. A few examples : Number of people followed by the publisher, Number of people followed by the person it's directed to, Number of people followed by both the publisher and the person it's directed to, Percentage of the publisher's follows also followed by the person it's directed to, sentiment (% positive) of past tweets done by sender, sentiment (% positive) of past tweets done by receiver, do they follow each other...
You have to use your knowledge of the problem to create such variables, and find the necessary info to create them (form APIs, etc). If you have enough of such variables, you can make each user fairly unique (just like an id variable would do). Then, you can test those variables on your model, make feature selection etc.
