lcc.stars_processing.utilities package

Submodules

lcc.stars_processing.utilities.base_decider module

class lcc.stars_processing.utilities.base_decider.BaseDecider[source]

Bases: object

A decider class works with “coordinates” (specification) of objects. It can learn identify inspected group of objects according to “coordinates” of searched objects and other objects.

All decider classes have to inherit this abstract class. That means that they need to implement several methods: “learn” and “evaluate”. Also all of them have to have “treshold” attribute. To be explained read comments below.

Attributes

treshold (float) Probability (1.0 means 100 %) level. All objects with probability of membership to the group higher then the treshold are considered as members.
treshold = 0.8  

Methods

evaluate(star_coords)[source]
Parameters:

star_coords : list

Coordinates of inspected star got from sub-filters

Returns:

list of lists

Probability that inspected star belongs to the searched group of objects

evaluateList(stars_coords)[source]
Parameters:

stars_coords : list

Coordinates of inspected stars (e.g. obtained from sub-filters)

Returns:

list

Probabilities that inspected stars belongs to the searched group of objects

filter(stars_coords, treshold=None)[source]
Parameters:

stars_coords : list

Coordinates of inspected stars

treshold : float

Treshold value for filtering (number from 0 to 1)

Returns:

List of True/False whether coordinates belong to the searched group of objects

getBestCoord(stars_coords)[source]
Parameters:

stars_coords : list

Coordinates of inspected stars got from sub-filters

Returns:

list

Coordinates with highest probability of membership to the searched group (one list of coordinates)

getStatistic(right_coords, wrong_coords, treshold=None)[source]
Parameters:

right_coords : list

Parameter-space coordinates of searched objects

wrong_coords : list

Parameter-space coordinates of other objects

treshold : float

Treshold value for filtering (number from 0 to 1)

Returns:

statistic information : dict

precision (float)

True positive / (true positive + false positive)

true_positive_rate (float)

Proportion of positives that are correctly identified as such

true_negative_rate :(float)

Proportion of negatives that are correctly identified as such

false_positive_rate (float)

Proportion of positives that are incorrectly identified as negatives

false_negative_rate (float)

Proportion of negatives that are incorrectly identified as positives

learn(right_coords, wrong_coords)[source]

After executing this method the decider object is capable to recognize objects according their “coordinates” via “filter” method.

Parameters:

right_coords : list

“Coordinates” of searched objects

wrong_coords : list

“Coordinates” of other objects

Returns:

NoneType

None

lcc.stars_processing.utilities.base_descriptor module

class lcc.stars_processing.utilities.base_descriptor.BaseDescriptor[source]

Bases: object

Methods

LABEL = ''
getSpaceCoords(*function_args, **function_args_dict)[source]

Get list of parameters coordinates according to descriptor implementation

Parameters:

stars : list of Star objects

Stars with color magnitudes in their ‘more’ attribute

Returns:

list

List of coordinates

class lcc.stars_processing.utilities.base_descriptor.Learnable[source]

Bases: object

Common class for all filters which are able to call “learn” by yourself. All these classes need to be able obtain their space coordinates via getSpaceCoords. Then the learning is the same (see learn method below).

Optionally there can be labels on plots if a class has label attribute, which is list of string contains label for data.

Also after learning the ‘learned’ attribute is set to ‘True’ if exists.

Moreover plot is saved if class has plot_save_path attribute is not None or ‘’

Methods

getSpaceCoords(stars)[source]
Parameters:

stars : list of Star objects

Returns:

list of lists

List of list of numbers (coordinates)

learn(searched_stars, contamination_stars, learn_num='')[source]

Teach filter to recognize searched stars

Parameters:

searched_stars : list of Star objects

Searched stars to learn

contamination_stars : list of Star objects

Contamination stars to learn

learn_num : str, int

Optional identifier for the learning

Returns:

None

lcc.stars_processing.utilities.compare module

class lcc.stars_processing.utilities.compare.ComparativeBase[source]

Bases: object

This class is responsible for comparing light curves of inspected stars with the template stars

Attributes

compar_stars (list, iterable) List of Star objects which represent searched group of star objects

Methods

compareTwoStars(*args, **kwargs)[source]
getSpaceCoords(stars)[source]

Apply all filters and get their space coordinates

Parameters:

stars : Star objects

Stars to filtering

Returns:

list

List of coordinates

loadCompStars(comp_stars)[source]

Load comparative stars for the template sample

Parameters:

comp_stars : list

Stars for the template

Returns:

None

lcc.stars_processing.utilities.sax module

exception lcc.stars_processing.utilities.sax.DictionarySizeIsNotSupported[source]

Bases: exceptions.ValueError

exception lcc.stars_processing.utilities.sax.OverlapSpecifiedIsNotSmallerThanWindowSize[source]

Bases: exceptions.ValueError

class lcc.stars_processing.utilities.sax.SAX(word_size=8, alphabet_size=10, scaling_factor=1)[source]

Bases: object

This class manages symbolic representation of data series via Symbolic Aggregate approXimation method. It translates series of data to a words, which can then be compared with other such words in symbolic distance space.

Attributes

word_size (int) Number of letters in transformed word
alphabet_size (int) Size of alphabet counted from A (3 means A, B, C)
scaling_factor (int, float) Scaling factor can be used to scale result dissimilarity of two words created from light curves of different lengths
beta (list) Breakpoints for given alphabets size

Methods

A_OFFSET = 97
MAX_ALPH_SIZE = 20
MIN_ALPH_SIZE = 3
alphabetize(paaX)[source]

Converts the Piecewise Aggregate Approximation of x to a series of letters.

paaX : list, iterable
Data series (list of numbers)
Returns:

str

SAX word

build_letter_compare_dict()[source]

Builds up the lookup table to determine numeric distance between two letters given an alphabet size.

Returns:None
compare_letters(la, lb)[source]

Compare two letters based on letter distance return distance between

la : str
First letter
lb : str
Second letter
Returns:

float

Distance between two letters

compare_strings(sA, sB)[source]

Compares two strings based on individual letter distances.

Parameters:

sA : str

Word to compare

aB : str

Word to compare

Returns:

float

Dissimilarity of two words

to_letter_rep(x)[source]

Function takes a series of data, x, and transforms it to a string representation.

Parameters:

x : list, iterable

Data series

Returns:

str

SAX word

list

Indices

lcc.stars_processing.utilities.superv_base_decider module

class lcc.stars_processing.utilities.superv_base_decider.SupervisedBase(clf, treshold=0.5)[source]

Bases: lcc.stars_processing.utilities.base_decider.BaseDecider

Base class for sklearn library supervised classes transformed to the package content. It is not intended to use this directly, but thru certain method subclasses.

Attributes

treshold (float) Border probability value (objects with probability higher then this value is considered as searched object)
learner (sklearn object) Learner object for desired method of supervised learning

Methods

evaluate(coords)[source]

Get probability of membership

Parameters:

coords : list of lists

List of prameter space coordinates

Returns:

list of floats

List of probabilities

learn(right_coords, wrong_coords)[source]

Learn to recognize objects

Parameters:

right_coords: iterable

List of coordinates (list of numbers) of searched objects

wrong_coords: iterable

List of coordinates (list of numbers) of contamination objects

Returns:

NoneType

None

lcc.stars_processing.utilities.symbolic_representation module

class lcc.stars_processing.utilities.symbolic_representation.SymbolicRepresentation[source]

Bases: object

This common class for all descriptors based on symbolic representation of data.

Methods

compareTwoStars(star, comp_star)[source]

Compare two stars according to a filter implementation

Parameters:

star : Star instance

Star to compare

comp_star : Star instance

Star to compare

Returns:

float

Dissimilarity of two stars

lcc.stars_processing.utilities.unsupervised_base module

class lcc.stars_processing.utilities.unsupervised_base.UnsupervisedBase(classifier, params, treshold=0.5, **kwargs)[source]

Bases: lcc.stars_processing.utilities.base_decider.BaseDecider

classdocs

Methods

evaluate(star_coords)[source]
learn(coords)[source]

Module contents

There are managers responsible for stars to have certain parameters for filtering