rail.estimation.informer module

Abstract base classes for Informers. These superstages ingest prior information, including training sets and explicit priors, and prepare a model that can be used to produce photo-z data products. They are distinguished by their input data types, and the models they output can be used for their corresponding Estimator, Summarizer, or Classifier stages.

class rail.estimation.informer.CatInformer(args, comm=None)[source]

Bases: RailStage

The base class for informing models used to make photo-z data products from catalog-like inputs (i.e., tables with fluxes in photometric bands among the set of columns).

Estimators use a generic “model”, the details of which depends on the sub-class. Most estimators will have associated Informer classes, which can be used to inform those models.

(Note, “Inform” is more generic than “Train” as it also applies to algorithms that are template-based rather than machine learning-based.)

Informer will produce as output a generic “model”, the details of which depends on the sub-class.

They take as “input” catalog-like tabular data, which is used to “inform” the model.

config_options = {'output_mode': <ceci.config.StageParameter object>}
inform(training_data)[source]

The main interface method for Informers

This will attach the input_data to this Informer (for introspection and provenance tracking).

Then it will call the run() and finalize() methods, which need to be implemented by the sub-classes.

The run() method will need to register the model that it creates to this Estimator by using self.add_data(‘model’, model).

Finally, this will return a ModelHandle providing access to the trained model.

Parameters:

input_data (dict or TableHandle) – dictionary of all input data, or a TableHandle providing access to it

Returns:

model – Handle providing access to trained model

Return type:

ModelHandle

inputs = [('input', <class 'rail.core.data.TableHandle'>)]
name = 'CatInformer'
outputs = [('model', <class 'rail.core.data.ModelHandle'>)]
class rail.estimation.informer.PzInformer(args, comm=None)[source]

Bases: RailStage

The base class for informing models used to make photo-z data products from existing ensembles of p(z) distributions.

PzSummarizers can use a generic “model”, the details of which depends on the sub-class. Some summaer will have associated PzInformer classes, which can be used to inform those models.

(Note, “Inform” is more generic than “Train” as it also applies to algorithms that are template-based rather than machine learning-based.)

PzInformer will produce as output a generic “model”, the details of which depends on the sub-class.

They take as “input” a qp.Ensemble of per-galaxy p(z) data, which is used to “inform” the model.

config_options = {'output_mode': <ceci.config.StageParameter object>}
inform(training_data)[source]

The main interface method for Informers

This will attach the input_data to this Informer (for introspection and provenance tracking).

Then it will call the run() and finalize() methods, which need to be implemented by the sub-classes.

The run() method will need to register the model that it creates to this Estimator by using self.add_data(‘model’, model).

Finally, this will return a ModelHandle providing access to the trained model.

Parameters:

input_data (qp.Ensemble) – Per-galaxy p(z), and any ancilary data associated with it

Returns:

model – Handle providing access to trained model

Return type:

ModelHandle

inputs = [('input', <class 'rail.core.data.QPHandle'>)]
name = 'PzInformer'
outputs = [('model', <class 'rail.core.data.ModelHandle'>)]