EpistasisLab / tpot

A Python Automated Machine Learning tool that optimizes machine learning pipelines using genetic programming.
http://epistasislab.github.io/tpot/
GNU Lesser General Public License v3.0
9.57k stars 1.55k forks source link

Feature to Export the Pipeline/Model as pickle file #1342

Open Ezzaldin97 opened 5 months ago

Ezzaldin97 commented 5 months ago

Hi,

I am trying to use TPOT to automate the training, but one of the problems that I've found is that there is no way to maintain reproducibility by setting the random state to all components in the pipeline that uses random state and exporting it directly as a pickle file.

perib commented 2 months ago

you could edit the configuration dictionary in the config file to manually set the random state variable for all estimators that take it. We have a new version of tpot, TPOT2, which does that for you as well. Just have to pass random_state to the TPOTClassifier/TPOTEstimator/TPOTRegressor. https://github.com/EpistasisLab/tpot2

you can also pickle the final pipelines manually. (I prefer to use dill to pickle). The final pipeline is found in the "fittedpipeline" attribute of the estimator.