BaseClassifier (starclass.BaseClassifier)

class starclass.BaseClassifier(level='L1', tset='keplerq9', features_cache=None, plot=False)[source]

The basic stellar classifier class for the TASOC pipeline. All other specific stellar classification algorithms will inherit from BaseClassifier.

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

__init__(level='L1', tset='keplerq9', features_cache=None, plot=False)[source]

Initialize the classifier object.

Parameters:plot (boolean, optional) – Create plots as part of the output. Default is False.
plot

Indicates wheter plotting is enabled.

Type:boolean
data_dir

Path to directory where classifiers store auxiliary data. Different directories will be used for each classification level.

Type:string
calc_features(lightcurve)[source]

Calculate other derived features from the lightcurve.

classify(features)[source]

Classify a star from the lightcurve and other features.

Will run the do_classify() method and check some of the output and calculate various performance metrics.

Parameters:features (dict) – Dictionary of features, including the lightcurve itself.
Returns:Dictionary of classifications
Return type:dict

See also

do_classify()

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

close()[source]

Close the classifier.

do_classify(features)[source]

This method should be overwritten by child classes.

Parameters:features (dict) – Dictionary of features of star, including the lightcurve itself.
Returns:Dictionary where the keys should be from StellarClasses and the corresponding values indicate the probability of the star belonging to that class.
Return type:dict
Raises:NotImplementedError
load_star(task, fname)[source]

Recieve a task from the TaskManager and load the lightcurve.

train(features, labels)[source]
Parameters:
  • features (iterable of dict) – Features of star, including the lightcurve itself.
  • labels (ndarray, [n_objects]) – labels for training set lightcurves.
Raises:

NotImplementedError