Functions to serialize and deserialize results #123
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR accomplishes 2 tasks:
Saving model results
Need:
We need to save our model evaluation results in a format that can be used later. This would make the results readily available and would save us the trouble of running the tasks multiple times to get those results.
Solution:
Added serializing and deserializing functions for the results and all relevant classes to be able to save those results as a valid JSON string which can be deserialized later on for further use.
Note: Pickle was tried earlier but the data kept getting corrupted without a tangible solution available. Hence, we shifted to using this strategy for saving the results.
Running tasks through a config JSON file
Need:
At present, having to run tasks is a cumbersome process of having to write the code for importing individual classes and the model and calling evaluate.
Solution:
This can be automated through a script that reads our task requirements from a JSON file and generates the aforementioned Python file for us to run. The PR adds:
tasks_config.json
:A config file containing information on the tasks and model. This is the only file we'll need to edit after this change to run tasks. The user needs to add the appropriate username and path for
out_file_location
andrelative_data_folder
before being able to use the script.make_script.py
:The script which would parse
tasks_config.json
and create the Python filerun_tasks.py
for the scheduler to run.run.sh
:The shell file which is specified in the scheduler script. It runs
make_script.py
andrun_tasks.py
in succession.