Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor to use a model class #15

Open
skewballfox opened this issue Mar 1, 2022 · 0 comments
Open

refactor to use a model class #15

skewballfox opened this issue Mar 1, 2022 · 0 comments

Comments

@skewballfox
Copy link
Collaborator

this is something which I was planning on doing once my schedule relented, but I may as well document the planned changes and rationale, in case anyone else would like to get to this before I do.

when I originally refactored the project to use an out directory, I appended "out/" + to a lot of directory calls intentionally, as I was trying to get a feel for what part of the codebase were producing output to the filesystem, but it was only meant as a stop gap measure. The plan is to create a model class that would be used in place of dictionary currently used to represent models.

the goal of the models class is to sit as a layer of abstraction between the file handling and model data(such as accuracy) and the code handling model logic. take for example the function split_incremental_results: instead of specifying the paths and the copying the directories to the training and test directories, you would do something like:

self.models[model].add_test_data(list_of_files)

the goal of this isn't abstraction for the sake of abstraction but making it to where pathing is mostly derived rather than hard coded. since all the models have the same directory layout, you can potentially make it to where you only feed the output directory and the model name during instantiation and then the pathing is handled (with getters to get file paths), and also allows you to conveniently access model properties(you can implement comparators in python using dunder methods, meaning something like get best model, could be the result of best_model=max(self.models)

this also makes it easy to change it to where files aren't moved or copied at all, only stored as list internally inside the model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant