Classifying Data

Data can be classified using the SimpleClassifier module. The list of time, light observation tuples can be passed into the classify_simple() function to yield a classification.

A result of True indicates that the observations appear to represent a transient, and a False value indicates that the observations appear to represent a non-transient.


In [1]:
from binaryclassifier import SimpleClassifier

transient = [(0, 5), (1, 7), (2, 4)]
SimpleClassifier.classify_simple(transient)


Out[1]:
True

In [2]:
from binaryclassifier import SimpleClassifier

non_transient = [(0, 5), (1, 5.02), (2, 4.97)]
SimpleClassifier.classify_simple(non_transient)


Out[2]:
False

Classifying Generated Data

In order to generate test data you should use the EmulatorMain module. The generated observations can then be passed into the classify_simple() function.


In [3]:
from binaryclassifier import EmulatorMain
from binaryclassifier import SimpleClassifier

em = EmulatorMain.EmulatorMain()
transient = em.generateSingleObject(True)
SimpleClassifier.classify_simple(transient)


Out[3]:
True

In [4]:
from binaryclassifier import EmulatorMain
from binaryclassifier import SimpleClassifier

em = EmulatorMain.EmulatorMain()
non_transient = em.generateSingleObject(False)
SimpleClassifier.classify_simple(non_transient)


Out[4]:
False