It is not necessarily clear how a trained model relates to the training data set. At the very least this depends very much on what exact model you are using, since some models abstract over the features in the data set, whereas other models might include verbatim samples. Even if the model abstracts over the data set, the model may carry some characteristics of the data set as whole or of individual samples.
It is not sufficient to talk about “an sklearn model”, as the library contains many different kinds of models. You will have to understand and analyze the specific model you are using.
From a copyright perspective, a trained model is not a creative work and therefore cannot be copyrighted by itself. However, it is possible to argue that the model is just a compiled form of the data set, so that any rights in the data set also extend to the model. This matters especially if you are in a jurisdiction with database rights.
But you used the word “confidential”, which is a completely separate concern from copyright. Your options here will depend on your jurisdiction, and under what circumstances you got access to the confidential dataset, for example if the data set is a trade secret at a company you are working at. Sharing a model trained from confidential data is generally not OK. If you are bound to confidentiality (implicitly, or explicitly by an NDA), first get authorization to share the model from the entity to which you owe confidentiality.
As an aside, one reason why a data set may be confidential could be because it contains data that is subject to the GDPR. The GDPR regulates the processing of personal data. Personal data is data that identifies a natural person, and other data that is linked with such identifying data. Any processing of personal data requires a legal basis. If we have a data set with personal data, using that data to train a model would be processing, and would require a legal basis.
But what about use of the trained model? This will depend on whether the model still contains personal data or is linked with identifying information in some form.
- A model that represents preferences, interests, or other characteristics of one person is clearly personal data, and sharing it would be processing that requires a legal basis.
- However, a model that summarizes or generalizes over a larger number of persons might no longer be linked with personal data, and would then be anonymous. Such anonymous data is not personal data, and would no longer be regulated by the GDPR.
- If one person's data has unusual data points and these are recognizeable in the model, that might make the person identifiable from the model. Such data would not be anonymous until identifying data is discarded or locked away, in order to prevent a user of the model to perform the identification.
So here the compliance obligations depend very much on what the data set represents, and what information is contained in the model.