Skip to content

Add Sklearn Save for Model to Rapidflow #27

@gebauerm

Description

@gebauerm

Rapidflow currently does not save sklearn models. This has to be added to the framework.
Implement propper saving for sklearn in the Study Result Saver: https://github.com/gebauerm/rapidFlow/blob/7fdcd0679c19fb18ca7a7448d23ed001e0d29748/rapidflow/experiments/study_result_saver.py#L7
Use the Strategy Pattern: https://refactoring.guru/design-patterns/strategy
Example in Python: https://refactoring.guru/design-patterns/strategy/python/example

Create a feature branch.
Create a ModelSaver class that is used by the StudyResultSaver to perform the Strategy. The strategy can be performed by calling self.model_saver.save_model() in the StudyResultSaver.
Strategies shall be kept in a Dict together with an Enum that refers to the specific strategy. The Dict shall be a static variable of ModelSaver. Check for the best way to initialize the Enum. I would advice to initialize it directly from the model class. If initialization fails due to unsupoported Classes provide a warning for the user, for the model being unable to save. Adding new Strategies shall be kept relatively simple by providing an interface for the programmer. Strategies shall thus all use the same interface and be kept in the same file as the interface.
Adjust the torch saving method accordingly.

Write tests for torch and sklearn saving and form the respective subfolder structure in the test folder.
Create a PR into develop.

For questions reach out to me.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions