actsnclass.DataBase.build_samples¶
-
DataBase.build_samples(initial_training='original', nclass=2, screen=False, Ia_frac=0.5, queryable=False, save_samples=False, sep_files=False, survey='DES', output_fname=' ', path_to_train=' ', path_to_queried=' ', method='Bazin')¶ Separate train and test samples.
Populate properties: train_features, train_header, test_features, test_header, queryable_ids (if flag available), train_labels and test_labels.
Parameters: - initial_training (str or int) – Choice of initial training sample. If ‘original’: begin from the train sample flagged in original file elif ‘previous’: continue from a previously run loop elif int: choose the required number of samples at random, ensuring that at least half are SN Ia.
- Ia_frac (float in [0,1] (optional)) – Fraction of Ia required in initial training sample. Default is 0.5.
- method (str (optional)) – Feature extraction method. The current implementation only accepts method==’Bazin’ or ‘photometry’. Default is ‘Bazin’. Only used if initial_training == ‘previous’.
- nclass (int (optional)) – Number of classes to consider in the classification Currently only nclass == 2 is implemented.
- path_to_train (str (optional)) – Path to initial training file from previous run. Only used if initial_training == ‘previous’.
- path_to_queried (str(optional)) – Path to queried sample from previous run. Only used if initial_training == ‘previous’.
- queryable (bool (optional)) – If True build also queryable sample for time domain analysis. Default is False.
- screen (bool (optional)) – If True display the dimensions of training and test samples.
- save_samples (bool (optional)) – If True, save training and test samples to file. Default is False.
- survey (str (optional)) – Survey used to obtain the data. The current implementation only accepts survey=’DES’ or ‘LSST’. Default is ‘DES’.
- sep_files (bool (optional)) – If True, consider train and test samples separately read from independent files. Default is False.
- output_fname (str (optional)) – Complete path to output file where initial training will be stored. Only used if save_samples == True.