Kepler Q9 (version 3) Training Set (starclass.training_sets.keplerq9v3)

class starclass.training_sets.keplerq9v3(*args, datalevel='corr', **kwargs)[source]

Bases: TrainingSet

Kepler Q9 Training Set (version 3).

Code author: Rasmus Handberg <rasmush@phys.au.dk>

__init__(*args, datalevel='corr', **kwargs)[source]

Initialize TrainingSet.

Parameters:
  • level (str) – Level of the classification. Choises are 'L1' and 'L2'. Default is level 1.

  • tf (float) – Test-fraction. Default=0.

  • linfit (bool) – Should linfit be enabled for the trainingset? If linfit is enabled, lightcurves will be detrended using a linear trend before passed on to have frequencies extracted. See BaseClassifier.calc_features() for details.

  • random_seed (int) – Random seed. Default=42.

  • datalevel (str) – Deprecated.

Code author: Rasmus Handberg <rasmush@phys.au.dk>

clear_cache()

Clear features cache.

This will delete the features cache directory in the training-set data directory, and delete all MOAT cache tables in the training-set.

Code author: Rasmus Handberg <rasmush@phys.au.dk>

close()
features()

Iterator of features for training.

Returns:

Iterator of dicts containing features to be used for training.

Return type:

Iterator

Code author: Rasmus Handberg <rasmush@phys.au.dk>

features_test()

Iterator of features for testing.

Returns:

Iterator of dicts containing features to be used for testing.

Return type:

Iterator

Code author: Rasmus Handberg <rasmush@phys.au.dk>

classmethod find_input_folder()

Find the folder containing the data for the training set.

This is a class method, so it can be called without having to initialize the training set.

folds(n_splits=5)

Split training set object into stratified folds.

Parameters:

n_splits (int, optional) – Number of folds to split training set into. Default=5.

Returns:

Iterator of folds, which are also

TrainingSet objects.

Return type:

Iterator of TrainingSet objects

generate_todolist()

Generate todo.sqlite file in training set directory.

Code author: Rasmus Handberg <rasmush@phys.au.dk>

labels()

Labels of training-set.

Returns:

Tuple of labels associated with features in features().

Each element is itself a tuple of enums of StellarClasses.

Return type:

tuple

Code author: Rasmus Handberg <rasmush@phys.au.dk>

labels_test()

Labels of test-set.

Returns:

Tuple of labels associated with features in features_test().

Each element is itself a tuple of enums of StellarClasses.

Return type:

tuple

Code author: Rasmus Handberg <rasmush@phys.au.dk>

load_targets()[source]
reload()

Reload in-memory TaskManager connected to TrainingSet todo-file.

tset_datadir(url)

Setup TrainingSet data directory. If the directory doesn’t already exist,

Parameters:

url (string) – URL from where to download the training-set if it doesn’t already exist.

Returns:

Path to directory where training set is stored.

Return type:

string

Code author: Rasmus Handberg <rasmush@phys.au.dk>

key = 'keplerq9v3'
class starclass.training_sets.keplerq9v3_instr(*args, datalevel='corr', **kwargs)[source]

Bases: TrainingSet

Kepler Q9 Training Set (version 3) including instrumental class.

Code author: Rasmus Handberg <rasmush@phys.au.dk>

__init__(*args, datalevel='corr', **kwargs)[source]

Initialize TrainingSet.

Parameters:
  • level (str) – Level of the classification. Choises are 'L1' and 'L2'. Default is level 1.

  • tf (float) – Test-fraction. Default=0.

  • linfit (bool) – Should linfit be enabled for the trainingset? If linfit is enabled, lightcurves will be detrended using a linear trend before passed on to have frequencies extracted. See BaseClassifier.calc_features() for details.

  • random_seed (int) – Random seed. Default=42.

  • datalevel (str) – Deprecated.

Code author: Rasmus Handberg <rasmush@phys.au.dk>

clear_cache()

Clear features cache.

This will delete the features cache directory in the training-set data directory, and delete all MOAT cache tables in the training-set.

Code author: Rasmus Handberg <rasmush@phys.au.dk>

close()
features()

Iterator of features for training.

Returns:

Iterator of dicts containing features to be used for training.

Return type:

Iterator

Code author: Rasmus Handberg <rasmush@phys.au.dk>

features_test()

Iterator of features for testing.

Returns:

Iterator of dicts containing features to be used for testing.

Return type:

Iterator

Code author: Rasmus Handberg <rasmush@phys.au.dk>

classmethod find_input_folder()

Find the folder containing the data for the training set.

This is a class method, so it can be called without having to initialize the training set.

folds(n_splits=5)

Split training set object into stratified folds.

Parameters:

n_splits (int, optional) – Number of folds to split training set into. Default=5.

Returns:

Iterator of folds, which are also

TrainingSet objects.

Return type:

Iterator of TrainingSet objects

generate_todolist()

Generate todo.sqlite file in training set directory.

Code author: Rasmus Handberg <rasmush@phys.au.dk>

labels()

Labels of training-set.

Returns:

Tuple of labels associated with features in features().

Each element is itself a tuple of enums of StellarClasses.

Return type:

tuple

Code author: Rasmus Handberg <rasmush@phys.au.dk>

labels_test()

Labels of test-set.

Returns:

Tuple of labels associated with features in features_test().

Each element is itself a tuple of enums of StellarClasses.

Return type:

tuple

Code author: Rasmus Handberg <rasmush@phys.au.dk>

load_targets()
reload()

Reload in-memory TaskManager connected to TrainingSet todo-file.

tset_datadir(url)

Setup TrainingSet data directory. If the directory doesn’t already exist,

Parameters:

url (string) – URL from where to download the training-set if it doesn’t already exist.

Returns:

Path to directory where training set is stored.

Return type:

string

Code author: Rasmus Handberg <rasmush@phys.au.dk>

datadir = 'keplerq9v3'
key = 'keplerq9v3-instr'