amarquand/PCNtoolkit

Start refactor with class skeleton

AuguB opened this issue · 0 comments

AuguB commented

Rough outline of the responsibilities:

NormData

  • Loading data from different formats (csv, nifti, cifti, fsl output)
  • Checking validity and safety of data
  • Holding train, test, val data
  • Holding predictions
  • Ensuring shape consistency
  • Provide convenient slicing and indexing

NormConf

  • Hold cross-validation configuration
  • Hold logging configuration (output directory, and logging folder and format)

NormBase

  • Contains the logic for cross-validation
  • Has concrete, model-agnostic implementations of fit, predict, fit-predict methods which receive and return NormData objects
  • Calls the abstract fit_model, predict_model, fit_predict_model which receive and return NormData objects
  • Performs basis expansions

NormHBR (example concrete implementation)

  • Has concrete implementations of fit_model, predict_model, and fit_predict_model, which receive and return NormData objects
  • Acts as an adapter to the HBR model

These classes compose the HBR module. They should be completely unaware of anything that starts with Norm

HBRConf

  • Contains all configuration parameters for the HBR class
  • Load and save functions (from/to JSON)
  • Checks consistency of parameter configurations

HBR

  • Concrete implementations of the fitting and prediction logic for hbr models
  • Uses pymc
  • receives and returns numpy arrays