Enable exporting trained models to text files to be able to import later

### Describe the workflow you want to enable

```python
from sklearn.datasets import fetch_california_housing
from sklearn.ensemble import RandomForestRegressor

# make data
X,y = fetch_california_housing(return_X_y=True)

# instantiate Random-Forest and fit it
rf_model = RandomForestRegressor(min_samples_leaf=5, random_state=0, n_jobs=-1)
rf_model.fit(X, y)

# export model to a text file, inspired by https://xgboost.readthedocs.io/en/release_3.0.0/python/python_api.html#xgboost.XGBRegressor.save_model
rf_model.save_model("model.json")


#################### in a new python environment
from sklearn.ensemble import RandomForestRegressor
rf_model2 = RandomForestRegressor(min_samples_leaf=5, random_state=0, n_jobs=-1)
rf_model2.load_model("model.json")
```

### Describe your proposed solution

The current recommended way I believe is to export fit (or trained) models is to serialize them using joblib, which depends on python version, joblib version and scikit-learn version too, and I presume this may lead to issues with OS and CPU architecture as well (windows or  GNU Linux and x86 or ARM64).

So, I request a way to export model's trained weights (or other relevant things like bins & trees for RandomForestRegressor) for it be to loaded from any scikit-learn version or python version or operating system. This is just how the big packages like [xgboost](https://xgboost.readthedocs.io/en/release_3.0.0/python/python_api.html#xgboost.XGBRegressor.save_model) and pytorch ([using `state_dict`](https://pytorch.org/docs/stable/generated/torch.nn.Module.html#torch.nn.Module.load_state_dict)) and hence transformers,  handle things. 

This would enable to change environments and platforms easily without having to train model for the new package-versions, architecture and OS again or every time an update in them is required.

### Describe alternatives you've considered, if relevant

There is no alternative to everything that scikit-learn offers as of now.

### Additional context

This has been provied above.

COMMENT:
Is this really such a niche issue?
We have hundreds of models trained using the scikit-learn version available at training time, and these models are then pickled for storage. To ensure reproducibility, we currently need to create and store an image with the exact training environment and later boot the corresponding image for inference.
This approach is quite unwieldy, and our security team is already urging us not to boot images that may contain vulnerabilities.

What we actually need is a way to store and load scikit-learn models independently of the scikit-learn version. I would assume that the learned parameters themselves should not change between library versions, as they are determined by the underlying mathematical model.

Unfortunately, skops.io doesn't solve the problem that we can't use the latest Python environment with “old” models. As suggested in the [scikit-learn model persistence documentation](https://scikit-learn.org/stable/model_persistence.html), we are currently experimenting with ONNX. However, implementation has been quite bumpy - support for scikit-learn models is limited, output structures differ, and some methods (e.g. StandardScaler.inverse_transform) are missing.
Since we don’t require many of ONNX's advanced features like platform independence, this feels like the wrong tool for the job. What we really need is a version-independent (de)serializer for scikit-learn models.

I'm curious how other teams are handling this in production, especially under strict security constraints.

Labels: New Feature, Needs Decision - Include Feature