AutoDQM / AutoDQM_ML

0 stars 5 forks source link

Si pca #16

Closed chosila closed 2 years ago

chosila commented 3 years ago

I forgot to write a description, sorry.

2 files modified:

  1. pca.py

    • save_model() : saves the pca parameters into a JSON file (.get_params() did not give all the attributes needed to rebuild the pca, so I stuck with copying over all the attributes manually)
    • load_model() : builds a new pca based on info from the JSON file
    • plot() : plots reconstructed histograms on top of original of given histograms, and reference run. Currenlty, only supports 1 ref run (if more is given, it will overwrite the previous run calculated. Ability to run more than 1 ref comparison, can be added later). It takes the same arguments as anomaly_detection_algorithm.evaluate(). The plot function currently has an x-axis that goes from [0,1]. If we want the x-axis to match the original histogram axis, I will need to work on it further, but I think for now, I can get this out, and other people can try to see how it works and start training.
  2. environment.yml

    • added matplotlib

1 file added:

  1. toy_workflowDT.py
    • modification of toy_workflow.py to show how the new functions are used.
sam-may commented 3 years ago

Hi @chosila , thanks for putting this together! I have one request before merging: could you move the pure plotting part of the histogram plots to a separate area, outside the PCA class, maybe in a autodqm_ml/plotting/plot_tools.py or similar script that then gets imported into the PCA class?

This way it can be more easily reused for the AutoEncoder class.