«  Utils   ::   Contents   ::   Run MLZ  »

Plotting

This is the plotting class in some detail, this is used for plotting some results for the photometric redshift problem. Check Running a test to check a quick view on how to use this.

Module author: Matias Carrasco Kind

class plotting.Qplot(inputs_file)

Creates a qplot instance to produce a set of useful plot for quick analysis

Parameters:inputs_file (str) – path to input file where all information and parameters are declared Input file template
plot_importance(result_id=0, Nzb=10, list_att='')

Plot ranking of importance of attributes used during the training/testing process

Note

The key OobError and VarImportance in Input file template must be set to ‘yes’ to compute these quantities

Parameters:
  • results_id (int) – Result id number as the output on the results folder, default 0
  • Nzb (int) – Number of redshift bins
plot_map(nmap=0, colbar='yes', min_m=-100, max_m=-100)

Plot a map created during the training process,

Parameters:
  • nmap (int) – Number of created map, default is 0
  • min_m (float) – Lower limit for coloring the cells, -100 uses min value
  • max_m (float) – Upper limit for coloring the cells, -100 uses max value
  • colbar (str) – Include a colorbar (‘yes’,’no’)
plot_pdf_use(result_id=0)

PLots the redshift distribution using PDFs and using one single estimator and a map of zphot vs zspec using also PDFs.

Note

The code utils/use_pdfs must be run first in order to create the needed files, it can be run in parallel

Parameters:result_id (int) – result id (run number) as appears on the results , default = 0
plot_results(result_1=0, zconf_1=0.0, result_2=0, zconf_2=0.0)

Plots a summary of main results for photometric redshifts, it has user interactive plots.

Parameters:
  • result_1 (int) – result id (run number) as appears on the results , default = 0 (uses mean of PDF for metrics)
  • zconf_1 (float) – confidence level cut for file 1
  • result_2 (int) – result id (run number) as appears on the results folder for a second optional file , default shows file 1 instead using the mode for the metrics
  • zconf_2 (float) – confidence level cut for file 2
plot_sparse(result_id=0, kgal=-1)

Plot original and sparse representation of a random select galaxy

Note

Both the original and the spare rep. files must exist

Parameters:
  • results_id (int) – Result id number as the output on the results folder, default 0
  • kgal (int) – Id for specific galaxy
plot_tree(ntree=0, save_files='no', fileroot='TPZ', path='')

Plot a tree created during the training process, uses the Graphviz package (dot and neato)

Parameters:
  • ntree (int) – Number of created tree, default is 0
  • save_files (str) – Saves the created files from Graphviz (the .png and the .dot files) ‘yes’/’no’
  • fileroot (str) – root name for saved files
  • path (str) – path name for output files

«  Utils   ::   Contents   ::   Run MLZ  »