TrainDispReconstructor#
- class ctapipe.tools.train_disp_reconstructor.TrainDispReconstructor(**kwargs: Any)[source]#
Bases:
Tool
Tool to train a
DispReconstructor
on dl1b/dl2 data.The tool first performs a cross validation to give an initial estimate on the quality of the estimation and then finally trains two models (estimating
norm(disp)
andsign(disp)
respectively) per telescope type on the full dataset.Attributes Summary
How many subarray events to load at once before training on n_events.
Number of events for training the models.
Number of threads to use for the reconstruction.
Output path for the trained reconstructor.
If true,
true_disp
is the distance between shower cog and the true source position along the reconstructed main shower axis.If false,true_disp
is the distance between shower cog and the true source position.Random seed for sampling training events.
Methods Summary
finish
()Write-out trained models and cross-validation results.
setup
()Initialize components from config.
start
()Train models per telescope type using a cross-validation.
Attributes Documentation
- aliases: StrDict = {'cv-output': 'CrossValidator.output_path', 'n-events': 'TrainDispReconstructor.n_events', 'n-jobs': 'DispReconstructor.n_jobs', ('i', 'input'): 'TableLoader.input_url', ('o', 'output'): 'TrainDispReconstructor.output_path'}#
- chunk_size#
How many subarray events to load at once before training on n_events.
- classes: ClassesType = [<class 'ctapipe.io.tableloader.TableLoader'>, <class 'ctapipe.reco.sklearn.DispReconstructor'>, <class 'ctapipe.reco.sklearn.CrossValidator'>]#
- description: str | Unicode[str, str | bytes] = '\n Tool to train a `~ctapipe.reco.DispReconstructor` on dl1b/dl2 data.\n\n The tool first performs a cross validation to give an initial estimate\n on the quality of the estimation and then finally trains two models\n (estimating ``norm(disp)`` and ``sign(disp)`` respectively) per\n telescope type on the full dataset.\n '#
- examples: str | Unicode[str, str | bytes] = '\n ctapipe-train-disp-reconstructor \\\n --config train_disp_reconstructor.yaml \\\n --input gamma.dl2.h5 \\\n --output disp_models.pkl\n '#
- n_events#
Number of events for training the models. If not given, all available events will be used.
- n_jobs#
Number of threads to use for the reconstruction. This overwrites the values in the config of each reconstructor.
- output_path#
Output path for the trained reconstructor. At the moment, pickle is the only supported format.
- project_disp#
If true,
true_disp
is the distance between shower cog and the true source position along the reconstructed main shower axis.If false,true_disp
is the distance between shower cog and the true source position.
- random_seed#
Random seed for sampling training events.
Methods Documentation