Skip to content

Added model saving, graphing, and renamed files for testing

Diarmuid Coleman requested to merge lin_reg_output_logging into main

After running PyTest on test_machine_learning_regression_session.py and passing the test I verified the results using graphing. From very rough testing it appears to be frequently inaccurate as a linear regression model. It's approximating the slope and intercept well enough half the time, but I have encountered some very inaccurate tests though so further refinement will be needed. The logged output seen when testing appears to show decent training loss reduction over the 10 epochs and each batch though. I have included one of the produced comparison plots:

image

I am now wondering if there might be use for including a non-testing version of the logger that would save some output to the results folder; that will need to be implemented. (Although this may already be easily possible via the prebuilt loggers/output_handlers but I might just be unaware!)

Additionally there might also be some potential interest in implementing some type of plotting/graphing via icflow although I am not too familiar with this at the moment. There's basic/barebones plot functionality in test_linear_regression.py, but I am happy to incorporate this elsewhere or move it somewhere more appropriate. I ultimately would like to remove test_linear_regression.py from the repo.

Changes made for this MR:

  • Added model save functionality.
  • Added plotting functionality for the linear regression model.
  • Enabled and completed testing.

Next steps to take:

  • Focus on testing the results of the model.
  • Tidy up and sort out the structure of all linear regression code.
Edited by Diarmuid Coleman

Merge request reports