SKLearnReconstructor#
- class ctapipe.reco.sklearn.SKLearnReconstructor(**kwargs: Any)[source]#
Bases:
Reconstructor
Base Class for a Machine Learning Based Reconstructor.
Keeps a dictionary of sklearn models, the current tools are designed to train one model per telescope type.
Attributes Summary
Features to use for this model.
If given, load serialized model from this path.
Which scikit-learn model to use.
kwargs for the sklearn model.
Prefix for the output of this model.
Property predicted, overridden in subclass.
Which stereo combination method to use.
Name of the target table column for training.
Methods Summary
__call__
(event)Event-wise prediction for the EventSource-Loop.
fit
(key, table)Create and fit a new model for
key
using the data intable
.predict_table
(key, table)Predict on a table of events.
write
(path[, overwrite])Attributes Documentation
- features#
Features to use for this model.
- instrument_table#
- load_path#
If given, load serialized model from this path.
- model_cls#
Which scikit-learn model to use.
- model_config#
kwargs for the sklearn model.
- prefix#
Prefix for the output of this model. If None,
model_cls
is used.
- property = None#
Property predicted, overridden in subclass.
- stereo_combiner_cls#
Which stereo combination method to use.. Possible values: []
Methods Documentation
- abstract __call__(event: ArrayEventContainer) None [source]#
Event-wise prediction for the EventSource-Loop.
Fills the event.dl2.<your-feature>[name] container.
- Parameters:
- event: ArrayEventContainer
- abstract predict_table(key, table: Table) Table [source]#
Predict on a table of events.
- Parameters:
- keyHashable
Key of the model. Currently always a
TelescopeDescription
as we train models per telescope type.- table
Table
Table of features
- Returns:
- table
Table
Table(s) with predictions, matches the corresponding container definition(s)
- table