Sharing a model trained on confidential data I have a regularized logistic regression model using scikit-learn and would like to share it with others, however the data it is trained on is confidential and must remain protected. The model uses bag-of-words style features to automatically classify texts describing injuries, and would be useful for a broad variety of injury surveillance tasks.
Is it possible to share a fully trained model like this without revealing potentially protected information, such as the words that occur in the texts it is trained on? If so, how would I do this, and how strong would the confidentiality protection be?
 A: You could use the hashing trick. That way rather than providing a table which maps words to indices, which would reveal information about the words in your training data, you could just provide a hash function.
A: Strictly speaking, this is not a stats question but a question of regulatory compliance. You need to run this past the ethics tsar at your institution, which I assume to be in the health care area. Some tsars will say, "No way, Jose", no matter how anonymized the data. Typically, if you collect data for one purpose, and obtain consent on that basis, you can't simply repurpose the data for something else. How the data may be used, once collected, will depend on your institution and your jurisdiction. If you are from Canada, best of luck, buddy.
I once wanted to use confidential data for illustrative purposes, and I suggested to my boss that I would draw random samples from the data (as you would for a bootstrap), so that the distributions would be similar, but none of the data would actually belong to real patients. I had multivariate data, and I was prepared to resample in a way that covariances and marginals were respected.
My suggestion was not accepted, largely because my boss did not understand it. 
But could you do something like that here? Scramble your data, so that sentences or "bags of words", get shuffled around different patients. The idea behind confidentiality is that people should not be able to find the patient or identify that person on the basis of the information they see. You don't want someone seeing the data and thinking, "I know that guy." 
A: You could retrain your model on a completely different set of words and then show it fully disclosed as a proof of concept, i.e. replace all the words with the names of animals, for example, and suggest to your intended audience that if they were to repeat your training steps exactly with more relevant words they could exactly replicate your model. 
