SKLearnReconstructor¶
-
class
ctapipe.reco.sklearn.
SKLearnReconstructor
(**kwargs: Any)[source]¶ Bases:
ctapipe.reco.reconstructor.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
An enum whose value must be in a given sequence.
kwargs for the sklearn model
Prefix for the output of this model.
property predicted, overridden in baseclass
Which stereo combination method to use.
Name of the target column in training table
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
¶ An enum whose value must be in a given sequence.
-
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 baseclass
-
stereo_combiner_cls
¶ Which stereo combination method to use. Possible values: []
Methods Documentation
-
abstract
__call__
(event: ctapipe.containers.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: astropy.table.table.Table) → astropy.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
-