feets.extractors package

Submodules

feets.extractors.core module

Features extractors base classes classes

class feets.extractors.core.Extractor(**cparams)[source]

Bases: object

Methods

extract(**kwargs)
fit()
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
extract(**kwargs)[source]
fit()[source]
classmethod get_data()[source]
classmethod get_default_params()[source]
classmethod get_dependencies()[source]
classmethod get_features()[source]
classmethod get_warnings()[source]
classmethod has_warnings()[source]
setup()[source]

This method will be executed before the feature is calculated

teardown()[source]

This method will be executed after the feature is calculated

exception feets.extractors.core.ExtractorBadDefinedError[source]

Bases: Exception

The extractor are not properly defined.

class feets.extractors.core.ExtractorConf(data, dependencies, params, features, warnings)

Bases: tuple

Attributes

data Alias for field number 0
dependencies Alias for field number 1
features Alias for field number 3
params Alias for field number 2
warnings Alias for field number 4

Methods

count(…)
index((value, [start, …) Raises ValueError if the value is not present.
data

Alias for field number 0

dependencies

Alias for field number 1

features

Alias for field number 3

params

Alias for field number 2

warnings

Alias for field number 4

exception feets.extractors.core.ExtractorContractError[source]

Bases: ValueError

The extractor dont get the expected features, data, parameters or wathever.

class feets.extractors.core.ExtractorMeta[source]

Bases: type

Methods

__call__($self, /, *args, **kwargs) Call self as a function.
mro(() -> list) return a type’s method resolution order
exception feets.extractors.core.ExtractorWarning[source]

Bases: UserWarning

Warn about the Extractor behavior.

exception feets.extractors.core.FeatureExtractionWarning[source]

Bases: UserWarning

Warn about calculation of some feature

feets.extractors.ext_amplitude module

class feets.extractors.ext_amplitude.Amplitude(**cparams)[source]

Bases: feets.extractors.core.Extractor

Amplitude

The amplitude is defined as the half of the difference between the median of the maximum 5% and the median of the minimum 5% magnitudes. For a sequence of numbers from 0 to 1000 the amplitude should be equal to 475.5.

References

[richards2011machine01]Richards, J. W., Starr, D. L., Butler, N. R., Bloom, J. S., Brewer, J. M., Crellin-Quick, A., … & Rischard, M. (2011). On machine-learned classification of variable stars with sparse and noisy time-series data. The Astrophysical Journal, 733(1), 10. Doi:10.1088/0004-637X/733/1/10.

Methods

extract(**kwargs)
fit(magnitude)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude)[source]

feets.extractors.ext_anderson_darling module

class feets.extractors.ext_anderson_darling.AndersonDarling(**cparams)[source]

Bases: feets.extractors.core.Extractor

AndersonDarling

The Anderson-Darling test is a statistical test of whether a given sample of data is drawn from a given probability distribution. When applied to testing if a normal distribution adequately describes a set of data, it is one of the most powerful statistical tools for detecting most departures from normality.

For a normal distribution the Anderson-Darling statistic should take values close to 0.25.

Warning

The original FATS documentation says that the result of AndersonDarling must be ~0.25 for gausian distribution but the result is ~-0.60

References

[kim2009trending23]Kim, D. W., Protopapas, P., Alcock, C., Byun, Y. I., & Bianco, F. (2009). De-Trending Time Series for Astronomical Variability Surveys. Monthly Notices of the Royal Astronomical Society, 397(1), 558-568. Doi:10.1111/j.1365-2966.2009.14967.x.

Methods

extract(**kwargs)
fit(magnitude)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude)[source]

feets.extractors.ext_autocor_length module

class feets.extractors.ext_autocor_length.AutocorLength(**cparams)[source]

Bases: feets.extractors.core.Extractor

Autocor_length

The autocorrelation, also known as serial correlation, is the cross-correlation of a signal with itself. Informally, it is the similarity between observations as a function of the time lag between them. It is a mathematical tool for finding repeating patterns, such as the presence of a periodic signal obscured by noise, or identifying the missing fundamental frequency in a signal implied by its harmonic frequencies.

For an observed series \(y_1, y_2,\dots,y_T\) with sample mean \(\bar{y}\), the sample lag \(-h\) autocorrelation is given by:

\[\rho_h = \frac{\sum_{t=h+1}^T (y_t - \bar{y})(y_{t-h}-\bar{y})} {\sum_{t=1}^T (y_t - \bar{y})^2}\]

Since the autocorrelation fuction of a light curve is given by a vector and we can only return one value as a feature, we define the length of the autocorrelation function where its value is smaller than \(e^{-1}\) .

References

[kim2011quasi45]Kim, D. W., Protopapas, P., Byun, Y. I., Alcock, C., Khardon, R., & Trichas, M. (2011). Quasi-stellar object selection algorithm using time variability and machine learning: Selection of 1620 quasi-stellar object candidates from MACHO Large Magellanic Cloud database. The Astrophysical Journal, 735(2), 68. Doi:10.1088/0004-637X/735/2/68.

Methods

extract(**kwargs)
fit(magnitude, nlags)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude, nlags)[source]

feets.extractors.ext_beyond1_std module

class feets.extractors.ext_beyond1_std.Beyond1Std(**cparams)[source]

Bases: feets.extractors.core.Extractor

Beyond1Std

Percentage of points beyond one standard deviation from the weighted mean. For a normal distribution, it should take a value close to 0.32:

>>> fs = feets.FeatureSpace(only=['Beyond1Std'])
>>> features, values = fs.extract(**lc_normal)
>>> dict(zip(features, values))
{'Beyond1Std': 0.317}

References

[richards2011machine67]Richards, J. W., Starr, D. L., Butler, N. R., Bloom, J. S., Brewer, J. M., Crellin-Quick, A., … & Rischard, M. (2011). On machine-learned classification of variable stars with sparse and noisy time-series data. The Astrophysical Journal, 733(1), 10. Doi:10.1088/0004-637X/733/1/10.

Methods

extract(**kwargs)
fit(magnitude, error)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude, error)[source]

feets.extractors.ext_car module

class feets.extractors.ext_car.CAR(**cparams)[source]

Bases: feets.extractors.core.Extractor

In order to model the irregular sampled times series we use CAR (Brockwell and Davis, 2002), a continious time auto regressive model.

CAR process has three parameters, it provides a natural and consistent way of estimating a characteristic time scale and variance of light-curves. CAR process is described by the following stochastic differential equation:

\[\begin{split}dX(t) = - \frac{1}{\tau} X(t)dt + \sigma_C \sqrt{dt} \epsilon(t) + bdt, \\ for \: \tau, \sigma_C, t \geq 0\end{split}\]

where the mean value of the lightcurve \(X(t)\) is \(b\tau\) and the variance is \(\frac{\tau\sigma_C^2}{2}\). \(\tau\) is the relaxation time of the process \(X(t)\), it can be interpreted as describing the variability amplitude of the time series. \(\sigma_C\) can be interpreted as describing the variability of the time series on time scales shorter than \(\tau\). \(\epsilon(t)\) is a white noise process with zero mean and variance equal to one.

The likelihood function of a CAR model for a light-curve with observations \(x - \{x_1, \dots, x_n\}\) observed at times \(\{t_1, \dots, t_n\}\) with measurements error variances \(\{\delta_1^2, \dots, \delta_n^2\}\) is:

\[ \begin{align}\begin{aligned}\begin{split}p (x|b,\sigma_C,\tau) = \prod_{i=1}^n \frac{1}{ [2 \pi (\Omega_i + \delta_i^2 )]^{1/2}} exp \{-\frac{1}{2} \frac{(\hat{x}_i - x^*_i )^2}{\Omega_i + \delta^2_i}\} \\\end{split}\\\begin{split}x_i^* = x_i - b\tau \\\end{split}\\\begin{split}\hat{x}_0 = 0 \\\end{split}\\\begin{split}\Omega_0 = \frac{\tau \sigma^2_C}{2} \\\end{split}\\\begin{split}\hat{x}_i = a_i\hat{x}_{i-1} + \frac{a_i \Omega_{i-1}}{\Omega_{i-1} + \delta^2_{i-1}} (x^*_{i-1} + \hat{x}_{i-1}) \\\end{split}\\\Omega_i = \Omega_0 (1- a_i^2 ) + a_i^2 \Omega_{i-1} (1 - \frac{\Omega_{i-1}}{\Omega_{i-1} + \delta^2_{i-1}} )\end{aligned}\end{align} \]

To find the optimal parameters we maximize the likelihood with respect to \(\sigma_C\) and \(\tau\) and calculate \(b\) as the mean magnitude of the light-curve divided by \(\tau\).

>>> fs = feets.FeatureSpace(
...     only=['CAR_sigma', 'CAR_tau','CAR_mean'])
>>> features, values = fs.extract(**lc_periodic)
>>> dict(zip(features, values))
{'CAR_mean': -9.230698873903961,
 'CAR_sigma': -0.21928049298842511,
 'CAR_tau': 0.64112037377348619}

References

[brockwell2002introduction810]Brockwell, P. J., & Davis, R. A. (2002). Introduction toTime Seriesand Forecasting.
[pichara2012improved810]Pichara, K., Protopapas, P., Kim, D. W., Marquette, J. B., & Tisserand, P. (2012). An improved quasar detection method in EROS-2 and MACHO LMC data sets. Monthly Notices of the Royal Astronomical Society, 427(2), 1284-1297. Doi:10.1111/j.1365-2966.2012.22061.x.

Methods

extract(**kwargs)
fit(magnitude, time, error, minimize_method)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude, time, error, minimize_method)[source]

feets.extractors.ext_color module

class feets.extractors.ext_color.Color(**cparams)[source]

Bases: feets.extractors.core.Extractor

Color

The color is defined as the difference between the average magnitude of two different bands observations.

>>> fs = feets.FeatureSpace(only=['Color'])
>>> features, values = fs.extract(**lc)
>>> dict(zip(features, values))
{'Color': -0.33325502453332145}

References

[kim2011quasi1213]Kim, D. W., Protopapas, P., Byun, Y. I., Alcock, C., Khardon, R., & Trichas, M. (2011). Quasi-stellar object selection algorithm using time variability and machine learning: Selection of 1620 quasi-stellar object candidates from MACHO Large Magellanic Cloud database. The Astrophysical Journal, 735(2), 68. Doi:10.1088/0004-637X/735/2/68.

Methods

extract(**kwargs)
fit(magnitude, magnitude2)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude, magnitude2)[source]

feets.extractors.ext_con module

class feets.extractors.ext_con.Con(**cparams)[source]

Bases: feets.extractors.core.Extractor

Con

Index introduced for the selection of variable stars from the OGLE database (Wozniak 2000). To calculate Con, we count the number of three consecutive data points that are brighter or fainter than \(2\sigma\) and normalize the number by \(N−2\).

For a normal distribution and by considering just one star, Con should take values close to 0.045:

>>> fs = feets.FeatureSpace(only=['Con'])
>>> features, values = fs.extract(**lc_normal)
>>> dict(zip(features, values))
{'Con': 0.0476}

References

[kim2011quasi1415]Kim, D. W., Protopapas, P., Byun, Y. I., Alcock, C., Khardon, R., & Trichas, M. (2011). Quasi-stellar object selection algorithm using time variability and machine learning: Selection of 1620 quasi-stellar object candidates from MACHO Large Magellanic Cloud database. The Astrophysical Journal, 735(2), 68. Doi:10.1088/0004-637X/735/2/68.

Methods

extract(**kwargs)
fit(magnitude, consecutiveStar)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude, consecutiveStar)[source]

feets.extractors.ext_eta_color module

class feets.extractors.ext_eta_color.EtaColor(**cparams)[source]

Bases: feets.extractors.core.Extractor

Eta_color (\(\eta_{color}\))

Variability index Eta_e (\(\eta^e\)) calculated from the color light-curve.

>>> fs = feets.FeatureSpace(only=['Eta_color'])
>>> features, values = fs.extract(**lc_normal)
>>> dict(zip(features, values))
{'Eta_color': 1.991749074648397}

References

[kim2014epoch1617]Kim, D. W., Protopapas, P., Bailer-Jones, C. A., Byun, Y. I., Chang, S. W., Marquette, J. B., & Shin, M. S. (2014). The EPOCH Project: I. Periodic Variable Stars in the EROS-2 LMC Database. arXiv preprint Doi:10.1051/0004-6361/201323252.

Methods

extract(**kwargs)
fit(aligned_magnitude, aligned_time, …)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(aligned_magnitude, aligned_time, aligned_magnitude2)[source]

feets.extractors.ext_eta_e module

class feets.extractors.ext_eta_e.Eta_e(**cparams)[source]

Bases: feets.extractors.core.Extractor

Eta_e (\(\eta^e\))

Variability index \(\eta\) is the ratio of the mean of the square of successive differences to the variance of data points. The index was originally proposed to check whether the successive data points are independent or not. In other words, the index was developed to check if any trends exist in the data (von Neumann 1941). It is defined as:

\[\eta = \frac{1}{(N-1)\sigma^2} \sum_{i=1}^{N-1} (m_{i+1}-m_i)^2\]

The variability index should take a value close to 2 for a normal distribution.

Although \(\eta\) is a powerful index for quantifying variability characteristics of a time series, it does not take into account unequal sampling. Thus \(\eta^r\) is defined as:

\[\eta^e = \bar{w} \, (t_{N-1} - t_1)^2 \frac{\sum_{i=1}^{N-1} w_i (m_{i+1} - m_i)^2} {\sigma^2 \sum_{i=1}^{N-1} w_i}\]

Where:

\[w_i = \frac{1}{(t_{i+1} - t_i)^2}\]

Example:

>>> fs = feets.FeatureSpace(only=['Eta_e'])
>>> features, values = fs.extract(**lc_normal)
>>> dict(zip(features, values))
{'Eta_e': 2.0028592616231866}

References

[kim2014epoch1819]Kim, D. W., Protopapas, P., Bailer-Jones, C. A., Byun, Y. I., Chang, S. W., Marquette, J. B., & Shin, M. S. (2014). The EPOCH Project: I. Periodic Variable Stars in the EROS-2 LMC Database. arXiv preprint Doi:10.1051/0004-6361/201323252.

Methods

extract(**kwargs)
fit(magnitude, time)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude, time)[source]

feets.extractors.ext_flux_percentile_ratio module

class feets.extractors.ext_flux_percentile_ratio.FluxPercentileRatioMid20(**cparams)[source]

Bases: feets.extractors.core.Extractor

In order to caracterize the sorted magnitudes distribution we use percentiles. If \(F_{5, 95}\) is the difference between 95% and 5% magnitude values, we calculate the following:

  • flux_percentile_ratio_mid20: ratio \(F_{40, 60}/F_{5, 95}\)
  • flux_percentile_ratio_mid35: ratio \(F_{32.5, 67.5}/F_{5, 95}\)
  • flux_percentile_ratio_mid50: ratio \(F_{25, 75}/F_{5, 95}\)
  • flux_percentile_ratio_mid65: ratio \(F_{17.5, 82.5}/F_{5, 95}\)
  • flux_percentile_ratio_mid80: ratio \(F_{10, 90}/F_{5, 95}\)

For the first feature for example, in the case of a normal distribution, this is equivalente to calculate:

\[\frac{erf^{-1}(2 \cdot 0.6-1)-erf^{-1}(2 \cdot 0.4-1)} {erf^{-1}(2 \cdot 0.95-1)-erf^{-1}(2 \cdot 0.05-1)}\]

So, the expected values for each of the flux percentile features are:

  • flux_percentile_ratio_mid20 = 0.154
  • flux_percentile_ratio_mid35 = 0.275
  • flux_percentile_ratio_mid50 = 0.410
  • flux_percentile_ratio_mid65 = 0.568
  • flux_percentile_ratio_mid80 = 0.779

References

[richards2011machine2025]Richards, J. W., Starr, D. L., Butler, N. R., Bloom, J. S., Brewer, J. M., Crellin-Quick, A., … & Rischard, M. (2011). On machine-learned classification of variable stars with sparse and noisy time-series data. The Astrophysical Journal, 733(1), 10. Doi:10.1088/0004-637X/733/1/10.

Methods

extract(**kwargs)
fit(magnitude)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude)[source]
class feets.extractors.ext_flux_percentile_ratio.FluxPercentileRatioMid35(**cparams)[source]

Bases: feets.extractors.core.Extractor

In order to caracterize the sorted magnitudes distribution we use percentiles. If \(F_{5, 95}\) is the difference between 95% and 5% magnitude values, we calculate the following:

  • flux_percentile_ratio_mid20: ratio \(F_{40, 60}/F_{5, 95}\)
  • flux_percentile_ratio_mid35: ratio \(F_{32.5, 67.5}/F_{5, 95}\)
  • flux_percentile_ratio_mid50: ratio \(F_{25, 75}/F_{5, 95}\)
  • flux_percentile_ratio_mid65: ratio \(F_{17.5, 82.5}/F_{5, 95}\)
  • flux_percentile_ratio_mid80: ratio \(F_{10, 90}/F_{5, 95}\)

For the first feature for example, in the case of a normal distribution, this is equivalente to calculate:

\[\frac{erf^{-1}(2 \cdot 0.6-1)-erf^{-1}(2 \cdot 0.4-1)} {erf^{-1}(2 \cdot 0.95-1)-erf^{-1}(2 \cdot 0.05-1)}\]

So, the expected values for each of the flux percentile features are:

  • flux_percentile_ratio_mid20 = 0.154
  • flux_percentile_ratio_mid35 = 0.275
  • flux_percentile_ratio_mid50 = 0.410
  • flux_percentile_ratio_mid65 = 0.568
  • flux_percentile_ratio_mid80 = 0.779

References

[richards2011machine2126]Richards, J. W., Starr, D. L., Butler, N. R., Bloom, J. S., Brewer, J. M., Crellin-Quick, A., … & Rischard, M. (2011). On machine-learned classification of variable stars with sparse and noisy time-series data. The Astrophysical Journal, 733(1), 10. Doi:10.1088/0004-637X/733/1/10.

Methods

extract(**kwargs)
fit(magnitude)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude)[source]
class feets.extractors.ext_flux_percentile_ratio.FluxPercentileRatioMid50(**cparams)[source]

Bases: feets.extractors.core.Extractor

In order to caracterize the sorted magnitudes distribution we use percentiles. If \(F_{5, 95}\) is the difference between 95% and 5% magnitude values, we calculate the following:

  • flux_percentile_ratio_mid20: ratio \(F_{40, 60}/F_{5, 95}\)
  • flux_percentile_ratio_mid35: ratio \(F_{32.5, 67.5}/F_{5, 95}\)
  • flux_percentile_ratio_mid50: ratio \(F_{25, 75}/F_{5, 95}\)
  • flux_percentile_ratio_mid65: ratio \(F_{17.5, 82.5}/F_{5, 95}\)
  • flux_percentile_ratio_mid80: ratio \(F_{10, 90}/F_{5, 95}\)

For the first feature for example, in the case of a normal distribution, this is equivalente to calculate:

\[\frac{erf^{-1}(2 \cdot 0.6-1)-erf^{-1}(2 \cdot 0.4-1)} {erf^{-1}(2 \cdot 0.95-1)-erf^{-1}(2 \cdot 0.05-1)}\]

So, the expected values for each of the flux percentile features are:

  • flux_percentile_ratio_mid20 = 0.154
  • flux_percentile_ratio_mid35 = 0.275
  • flux_percentile_ratio_mid50 = 0.410
  • flux_percentile_ratio_mid65 = 0.568
  • flux_percentile_ratio_mid80 = 0.779

References

[richards2011machine2227]Richards, J. W., Starr, D. L., Butler, N. R., Bloom, J. S., Brewer, J. M., Crellin-Quick, A., … & Rischard, M. (2011). On machine-learned classification of variable stars with sparse and noisy time-series data. The Astrophysical Journal, 733(1), 10. Doi:10.1088/0004-637X/733/1/10.

Methods

extract(**kwargs)
fit(magnitude)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude)[source]
class feets.extractors.ext_flux_percentile_ratio.FluxPercentileRatioMid65(**cparams)[source]

Bases: feets.extractors.core.Extractor

In order to caracterize the sorted magnitudes distribution we use percentiles. If \(F_{5, 95}\) is the difference between 95% and 5% magnitude values, we calculate the following:

  • flux_percentile_ratio_mid20: ratio \(F_{40, 60}/F_{5, 95}\)
  • flux_percentile_ratio_mid35: ratio \(F_{32.5, 67.5}/F_{5, 95}\)
  • flux_percentile_ratio_mid50: ratio \(F_{25, 75}/F_{5, 95}\)
  • flux_percentile_ratio_mid65: ratio \(F_{17.5, 82.5}/F_{5, 95}\)
  • flux_percentile_ratio_mid80: ratio \(F_{10, 90}/F_{5, 95}\)

For the first feature for example, in the case of a normal distribution, this is equivalente to calculate:

\[\frac{erf^{-1}(2 \cdot 0.6-1)-erf^{-1}(2 \cdot 0.4-1)} {erf^{-1}(2 \cdot 0.95-1)-erf^{-1}(2 \cdot 0.05-1)}\]

So, the expected values for each of the flux percentile features are:

  • flux_percentile_ratio_mid20 = 0.154
  • flux_percentile_ratio_mid35 = 0.275
  • flux_percentile_ratio_mid50 = 0.410
  • flux_percentile_ratio_mid65 = 0.568
  • flux_percentile_ratio_mid80 = 0.779

References

[richards2011machine2328]Richards, J. W., Starr, D. L., Butler, N. R., Bloom, J. S., Brewer, J. M., Crellin-Quick, A., … & Rischard, M. (2011). On machine-learned classification of variable stars with sparse and noisy time-series data. The Astrophysical Journal, 733(1), 10. Doi:10.1088/0004-637X/733/1/10.

Methods

extract(**kwargs)
fit(magnitude)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude)[source]
class feets.extractors.ext_flux_percentile_ratio.FluxPercentileRatioMid80(**cparams)[source]

Bases: feets.extractors.core.Extractor

In order to caracterize the sorted magnitudes distribution we use percentiles. If \(F_{5, 95}\) is the difference between 95% and 5% magnitude values, we calculate the following:

  • flux_percentile_ratio_mid20: ratio \(F_{40, 60}/F_{5, 95}\)
  • flux_percentile_ratio_mid35: ratio \(F_{32.5, 67.5}/F_{5, 95}\)
  • flux_percentile_ratio_mid50: ratio \(F_{25, 75}/F_{5, 95}\)
  • flux_percentile_ratio_mid65: ratio \(F_{17.5, 82.5}/F_{5, 95}\)
  • flux_percentile_ratio_mid80: ratio \(F_{10, 90}/F_{5, 95}\)

For the first feature for example, in the case of a normal distribution, this is equivalente to calculate:

\[\frac{erf^{-1}(2 \cdot 0.6-1)-erf^{-1}(2 \cdot 0.4-1)} {erf^{-1}(2 \cdot 0.95-1)-erf^{-1}(2 \cdot 0.05-1)}\]

So, the expected values for each of the flux percentile features are:

  • flux_percentile_ratio_mid20 = 0.154
  • flux_percentile_ratio_mid35 = 0.275
  • flux_percentile_ratio_mid50 = 0.410
  • flux_percentile_ratio_mid65 = 0.568
  • flux_percentile_ratio_mid80 = 0.779

References

[richards2011machine2429]Richards, J. W., Starr, D. L., Butler, N. R., Bloom, J. S., Brewer, J. M., Crellin-Quick, A., … & Rischard, M. (2011). On machine-learned classification of variable stars with sparse and noisy time-series data. The Astrophysical Journal, 733(1), 10. Doi:10.1088/0004-637X/733/1/10.

Methods

extract(**kwargs)
fit(magnitude)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude)[source]

feets.extractors.ext_fourier_components module

class feets.extractors.ext_fourier_components.FourierComponents(**cparams)[source]

Bases: feets.extractors.core.Extractor

Periodic features extracted from light-curves using Lomb–Scargle (Richards et al., 2011)

Here, we adopt a model where the time series of the photometric magnitudes of variable stars is modeled as a superposition of sines and cosines:

\[y_i(t|f_i) = a_i\sin(2\pi f_i t) + b_i\cos(2\pi f_i t) + b_{i,\circ}\]

where \(a\) and \(b\) are normalization constants for the sinusoids of frequency \(f_i\) and \(b_{i,\circ}\) is the magnitude offset.

To find periodic variations in the data, we fit the equation above by minimizing the sum of squares, which we denote \(\chi^2\):

\[\chi^2 = \sum_k \frac{(d_k - y_i(t_k))^2}{\sigma_k^2}\]

where \(\sigma_k\) is the measurement uncertainty in data point \(d_k\). We allow the mean to float, leading to more robust period estimates in the case where the periodic phase is not uniformly sampled; in these cases, the model light curve has a non-zero mean. This can be important when searching for periods on the order of the data span \(T_{tot}\). Now, define

\[\chi^2_{\circ} = \sum_k \frac{(d_k - \mu)^2}{\sigma_k^2}\]

where \(\mu\) is the weighted mean

\[\mu = \frac{\sum_k d_k / \sigma_k^2}{\sum_k 1/\sigma_k^2}\]

Then, the generalized Lomb-Scargle periodogram is:

\[P_f(f) = \frac{(N-1)}{2} \frac{\chi_{\circ}^2 - \chi_m^2(f)} {\chi_{\circ}^2}\]

where \(\chi_m^2(f)\) is \(\chi^2\) minimized with respect to \(a, b\) and \(b_{\circ}\).

Following Debosscher et al. (2007), we fit each light curve with a linear term plus a harmonic sum of sinusoids:

\[y(t) = ct + \sum_{i=1}^{3}\sum_{j=1}^{4} y_i(t|jf_i)\]

where each of the three test frequencies \(f_i\) is allowed to have four harmonics at frequencies \(f_{i,j} = jf_i\). The three test frequencies \(f_i\) are found iteratively, by successfully finding and removing periodic signal producing a peak in \(P_f(f)\) , where \(P_f(f)\) is the Lomb-Scargle periodogram as defined above.

Given a peak in \(P_f(f)\), we whiten the data with respect to that frequency by fitting away a model containing that frequency as well as components with frequencies at 2, 3, and 4 times that fundamental frequency (harmonics). Then, we subtract that model from the data, update \(\chi_{\circ}^2\), and recalculate \(P_f(f)\) to find more periodic components.

Algorithm:

  1. For \(i = {1, 2, 3}\)
  2. Calculate Lomb-Scargle periodogram \(P_f(f)\) for light curve.
  3. Find peak in \(P_f(f)\), subtract that model from data.
  4. Update \(\chi_{\circ}^2\), return to Step 1.

Then, the features extracted are given as an amplitude and a phase:

\[\begin{split}A_{i,j} = \sqrt{a_{i,j}^2 + b_{i,j}^2}\\ \textrm{PH}_{i,j} = \arctan(\frac{b_{i,j}}{a_{i,j}})\end{split}\]

where \(A_{i,j}\) is the amplitude of the \(j-th\) harmonic of the \(i-th\) frequency component and \(\textrm{PH}_{i,j}\) is the phase component, which we then correct to a relative phase with respect to the phase of the first component:

\[\textrm{PH}'_{i,j} = \textrm{PH}_{i,j} - \textrm{PH}_{00}\]

and remapped to \(|-\pi, +\pi|\)

References

[richards2011machine3031]Richards, J. W., Starr, D. L., Butler, N. R., Bloom, J. S., Brewer, J. M., Crellin-Quick, A., … & Rischard, M. (2011). On machine-learned classification of variable stars with sparse and noisy time-series data. The Astrophysical Journal, 733(1), 10. Doi:10.1088/0004-637X/733/1/10.

Methods

extract(**kwargs)
fit(magnitude, time, lscargle_kwds)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude, time, lscargle_kwds)[source]

feets.extractors.ext_gskew module

class feets.extractors.ext_gskew.Gskew(**cparams)[source]

Bases: feets.extractors.core.Extractor

Median-of-magnitudes based measure of the skew.

\[Gskew = m_{q3} + m_{q97} - 2m\]

Where:

  • \(m_{q3}\) is the median of magnitudes lesser or equal than the quantile 3.
  • \(m_{q97}\) is the median of magnitudes greater or equal than the quantile 97.
  • \(m\) is the median of magnitudes.

Methods

extract(**kwargs)
fit(magnitude)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude)[source]

feets.extractors.ext_linear_trend module

class feets.extractors.ext_linear_trend.LinearTrend(**cparams)[source]

Bases: feets.extractors.core.Extractor

LinearTrend

Slope of a linear fit to the light-curve.

>>> fs = feets.FeatureSpace(only=['LinearTrend'])
>>> features, values = fs.extract(**lc_normal)
>>> dict(zip(features, values))
{'LinearTrend': -3.2084065290292509e-06}

References

[richards2011machine3233]Richards, J. W., Starr, D. L., Butler, N. R., Bloom, J. S., Brewer, J. M., Crellin-Quick, A., … & Rischard, M. (2011). On machine-learned classification of variable stars with sparse and noisy time-series data. The Astrophysical Journal, 733(1), 10. Doi:10.1088/0004-637X/733/1/10.

Methods

extract(**kwargs)
fit(magnitude, time)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude, time)[source]

feets.extractors.ext_lomb_scargle module

class feets.extractors.ext_lomb_scargle.LombScargle(**cparams)[source]

Bases: feets.extractors.core.Extractor

PeriodLS

The Lomb-Scargle (L-S) algorithm (Scargle, 1982) is a variation of the Discrete Fourier Transform (DFT), in which a time series is decomposed into a linear combination of sinusoidal functions. The basis of sinusoidal functions transforms the data from the time domain to the frequency domain. DFT techniques often assume evenly spaced data points in the time series, but this is rarely the case with astrophysical time-series data. Scargle has derived a formula for transform coefficients that is similiar to the DFT in the limit of evenly spaced observations. In addition, an adjustment of the values used to calculate the transform coefficients makes the transform invariant to time shifts.

The Lomb-Scargle periodogram is optimized to identify sinusoidal-shaped periodic signals in time-series data. Particular applications include radial velocity data and searches for pulsating variable stars. L-S is not optimal for detecting signals from transiting exoplanets, where the shape of the periodic light-curve is not sinusoidal.

Next, we perform a test on the synthetic periodic light-curve we created (which period is 20) to confirm the accuracy of the period found by the L-S method

Period_fit

The false alarm probability of the largest periodogram value. Let’s test it for a normal distributed data and for a periodic one.

Psi_CS (\(\Psi_{CS}\))

\(R_{CS}\) applied to the phase-folded light curve (generated using the period estimated from the Lomb-Scargle method).

Psi_eta (\(\Psi_{\eta}\))

\(\eta^e\) index calculated from the folded light curve.

References

[kim2011quasi3436]Kim, D. W., Protopapas, P., Byun, Y. I., Alcock, C., Khardon, R., & Trichas, M. (2011). Quasi-stellar object selection algorithm using time variability and machine learning: Selection of 1620 quasi-stellar object candidates from MACHO Large Magellanic Cloud database. The Astrophysical Journal, 735(2), 68. Doi:10.1088/0004-637X/735/2/68.
[kim2014epoch3436]Kim, D. W., Protopapas, P., Bailer-Jones, C. A., Byun, Y. I., Chang, S. W., Marquette, J. B., & Shin, M. S. (2014). The EPOCH Project: I. Periodic Variable Stars in the EROS-2 LMC Database. arXiv preprint Doi:10.1051/0004-6361/201323252.

Methods

extract(**kwargs)
fit(magnitude, time, lscargle_kwds, fap_kwds)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude, time, lscargle_kwds, fap_kwds)[source]
feets.extractors.ext_lomb_scargle.fap(power, fmax, time, mag, method, normalization, method_kwds=None)[source]
feets.extractors.ext_lomb_scargle.lscargle(time, magnitude, error=None, model_kwds=None, autopower_kwds=None)[source]

feets.extractors.ext_max_slope module

class feets.extractors.ext_max_slope.MaxSlope(**cparams)[source]

Bases: feets.extractors.core.Extractor

MaxSlope

Maximum absolute magnitude slope between two consecutive observations.

Examining successive (time-sorted) magnitudes, the maximal first difference (value of delta magnitude over delta time)

>>> fs = feets.FeatureSpace(only=['MaxSlope'])
>>> features, values = fs.extract(**lc_normal)
>>> dict(zip(features, values))
{'MaxSlope': 5.4943105823904741}

References

[richards2011machine3839]Richards, J. W., Starr, D. L., Butler, N. R., Bloom, J. S., Brewer, J. M., Crellin-Quick, A., … & Rischard, M. (2011). On machine-learned classification of variable stars with sparse and noisy time-series data. The Astrophysical Journal, 733(1), 10. Doi:10.1088/0004-637X/733/1/10.

Methods

extract(**kwargs)
fit(magnitude, time, timesort)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude, time, timesort)[source]

feets.extractors.ext_mean module

class feets.extractors.ext_mean.Mean(**cparams)[source]

Bases: feets.extractors.core.Extractor

Mean

Mean magnitude. For a normal distribution it should take a value close to zero:

>>> fs = feets.FeatureSpace(only=['Mean'])
>>> features, values = fs.extract(**lc_normal)
>>> dict(zip(features, values))
{'Mean': 0.0082611563419413246}

References

[kim2014epoch4041]Kim, D. W., Protopapas, P., Bailer-Jones, C. A., Byun, Y. I., Chang, S. W., Marquette, J. B., & Shin, M. S. (2014). The EPOCH Project: I. Periodic Variable Stars in the EROS-2 LMC Database. arXiv preprint Doi:10.1051/0004-6361/201323252.

Methods

extract(**kwargs)
fit(magnitude)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude)[source]

feets.extractors.ext_mean_variance module

class feets.extractors.ext_mean_variance.MeanVariance(**cparams)[source]

Bases: feets.extractors.core.Extractor

Meanvariance (\(\frac{\sigma}{\bar{m}}\))

This is a simple variability index and is defined as the ratio of the standard deviation \(\sigma\), to the mean magnitude, \(\bar{m}\). If a light curve has strong variability, \(\frac{\sigma}{\bar{m}}\) of the light curve is generally large.

For a uniform distribution from 0 to 1, the mean is equal to 0.5 and the variance is equal to 1/12, thus the mean-variance should take a value close to 0.577:

>>> fs = feets.FeatureSpace(only=['Meanvariance'])
>>> features, values = fs.extract(**lc_uniform)
>>> dict(zip(features, values))
{'Meanvariance': 0.5816791217381897}

References

[kim2011quasi4243]Kim, D. W., Protopapas, P., Byun, Y. I., Alcock, C., Khardon, R., & Trichas, M. (2011). Quasi-stellar object selection algorithm using time variability and machine learning: Selection of 1620 quasi-stellar object candidates from MACHO Large Magellanic Cloud database. The Astrophysical Journal, 735(2), 68. Doi:10.1088/0004-637X/735/2/68.

Methods

extract(**kwargs)
fit(magnitude)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude)[source]

feets.extractors.ext_median_abs_dev module

class feets.extractors.ext_median_abs_dev.MedianAbsDev(**cparams)[source]

Bases: feets.extractors.core.Extractor

MedianAbsDev

The median absolute deviation is defined as the median discrepancy of the data from the median data:

\[Median Absolute Deviation = median(|mag - median(mag)|)\]

It should take a value close to 0.675 for a normal distribution:

>>> fs = feets.FeatureSpace(only=['MedianAbsDev'])
>>> features, values = fs.extract(**lc_normal)
>>> dict(zip(features, values))
{'MedianAbsDev': 0.66332131466690614}

References

[richards2011machine4445]Richards, J. W., Starr, D. L., Butler, N. R., Bloom, J. S., Brewer, J. M., Crellin-Quick, A., … & Rischard, M. (2011). On machine-learned classification of variable stars with sparse and noisy time-series data. The Astrophysical Journal, 733(1), 10. Doi:10.1088/0004-637X/733/1/10.

Methods

extract(**kwargs)
fit(magnitude)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude)[source]

feets.extractors.ext_median_brp module

class feets.extractors.ext_median_brp.MedianBRP(**cparams)[source]

Bases: feets.extractors.core.Extractor

MedianBRP (Median buffer range percentage)

Fraction (<= 1) of photometric points within amplitude/10 of the median magnitude

>>> fs = feets.FeatureSpace(only=['MedianBRP'])
>>> features, values = fs.extract(**lc_normal)
>>> dict(zip(features, values))
{'MedianBRP': 0.559}

References

[richards2011machine4647]Richards, J. W., Starr, D. L., Butler, N. R., Bloom, J. S., Brewer, J. M., Crellin-Quick, A., … & Rischard, M. (2011). On machine-learned classification of variable stars with sparse and noisy time-series data. The Astrophysical Journal, 733(1), 10. Doi:10.1088/0004-637X/733/1/10.

Methods

extract(**kwargs)
fit(magnitude)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude)[source]

feets.extractors.ext_pair_slope_trend module

class feets.extractors.ext_pair_slope_trend.PairSlopeTrend(**cparams)[source]

Bases: feets.extractors.core.Extractor

PairSlopeTrend

Considering the last 30 (time-sorted) measurements of source magnitude, the fraction of increasing first differences minus the fraction of decreasing first differences.

>>> fs = feets.FeatureSpace(only=['PairSlopeTrend'])
>>> features, values = fs.extract(**lc_normal)
>>> dict(zip(features, values))
{'PairSlopeTrend': -0.16666666666666666}

References

[richards2011machine4849]Richards, J. W., Starr, D. L., Butler, N. R., Bloom, J. S., Brewer, J. M., Crellin-Quick, A., … & Rischard, M. (2011). On machine-learned classification of variable stars with sparse and noisy time-series data. The Astrophysical Journal, 733(1), 10. Doi:10.1088/0004-637X/733/1/10.

Methods

extract(**kwargs)
fit(magnitude)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude)[source]

feets.extractors.ext_percent_amplitude module

class feets.extractors.ext_percent_amplitude.PercentAmplitude(**cparams)[source]

Bases: feets.extractors.core.Extractor

PercentAmplitude

Largest percentage difference between either the max or min magnitude and the median.

>>> fs = feets.FeatureSpace(only=['PercentAmplitude'])
>>> features, values = fs.extract(**lc_normal)
>>> dict(zip(features, values))
{'PercentAmplitude': -168.991253993057}

References

[richards2011machine5051]Richards, J. W., Starr, D. L., Butler, N. R., Bloom, J. S., Brewer, J. M., Crellin-Quick, A., … & Rischard, M. (2011). On machine-learned classification of variable stars with sparse and noisy time-series data. The Astrophysical Journal, 733(1), 10. Doi:10.1088/0004-637X/733/1/10.

Methods

extract(**kwargs)
fit(magnitude)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude)[source]

feets.extractors.ext_percent_difference_flux_percentile module

class feets.extractors.ext_percent_difference_flux_percentile.PercentDifferenceFluxPercentile(**cparams)[source]

Bases: feets.extractors.core.Extractor

PercentDifferenceFluxPercentile

Ratio of \(F_{5, 95}\) over the median magnitude.

>>> fs = feets.FeatureSpace(only=['PercentDifferenceFluxPercentile'])
>>> features, values = fs.extract(**lc_normal)
>>> dict(zip(features, values))
{'PercentDifferenceFluxPercentile': -134.93590403825007}

References

[richards2011machine5253]Richards, J. W., Starr, D. L., Butler, N. R., Bloom, J. S., Brewer, J. M., Crellin-Quick, A., … & Rischard, M. (2011). On machine-learned classification of variable stars with sparse and noisy time-series data. The Astrophysical Journal, 733(1), 10. Doi:10.1088/0004-637X/733/1/10.

Methods

extract(**kwargs)
fit(magnitude)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude)[source]

feets.extractors.ext_q31 module

class feets.extractors.ext_q31.Q31(**cparams)[source]

Bases: feets.extractors.core.Extractor

Q31 (\(Q_{3-1}\))

\(Q_{3-1}\) is the difference between the third quartile, \(Q_3\), and the first quartile, \(Q_1\), of a raw light curve. \(Q_1\) is a split between the lowest 25% and the highest 75% of data. \(Q_3\) is a split between the lowest 75% and the highest 25% of data.

>>> fs = feets.FeatureSpace(only=['Q31'])
>>> features, values = fs.extract(**lc_normal)
>>> dict(zip(features, values))
{'Q31': 1.3320376563134508}

References

[kim2014epoch5456]Kim, D. W., Protopapas, P., Bailer-Jones, C. A., Byun, Y. I., Chang, S. W., Marquette, J. B., & Shin, M. S. (2014). The EPOCH Project: I. Periodic Variable Stars in the EROS-2 LMC Database. arXiv preprint Doi:10.1051/0004-6361/201323252.

Methods

extract(**kwargs)
fit(magnitude)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude)[source]
class feets.extractors.ext_q31.Q31Color(**cparams)[source]

Bases: feets.extractors.core.Extractor

Q31_color (\(Q_{3-1|B-R}\))

\(Q_{3-1}\) applied to the difference between both bands of a light curve (B-R).

>>> fs = feets.FeatureSpace(only=['Q31_color'])
>>> features, values = fs.extract(**lc_normal)
>>> dict(zip(features, values))
{'Q31_color': 1.8840489594535512}

References

[kim2014epoch5557]Kim, D. W., Protopapas, P., Bailer-Jones, C. A., Byun, Y. I., Chang, S. W., Marquette, J. B., & Shin, M. S. (2014). The EPOCH Project: I. Periodic Variable Stars in the EROS-2 LMC Database. arXiv preprint Doi:10.1051/0004-6361/201323252.

Methods

extract(**kwargs)
fit(aligned_magnitude, aligned_magnitude2)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(aligned_magnitude, aligned_magnitude2)[source]

feets.extractors.ext_rcs module

class feets.extractors.ext_rcs.RCS(**cparams)[source]

Bases: feets.extractors.core.Extractor

Rcs - Range of cumulative sum (\(R_{cs}\))

\(R_{cs}\) is the range of a cumulative sum (Ellaway 1978) of each light-curve and is defined as:

\[\begin{split}R_{cs} = max(S) - min(S) \\ S = \frac{1}{N \sigma} \sum_{i=1}^l (m_i - \bar{m})\end{split}\]

where max(min) is the maximum (minimum) value of S and \(l=1,2, \dots, N\).

\(R_{cs}\) should take a value close to zero for any symmetric distribution:

>>> fs = feets.FeatureSpace(only=['Rcs'])
>>> features, values = fs.extract(**lc_normal)
>>> dict(zip(features, values))
{'Rcs': 0.0094459606901065168}

References

[kim2011quasi5859]Kim, D. W., Protopapas, P., Byun, Y. I., Alcock, C., Khardon, R., & Trichas, M. (2011). Quasi-stellar object selection algorithm using time variability and machine learning: Selection of 1620 quasi-stellar object candidates from MACHO Large Magellanic Cloud database. The Astrophysical Journal, 735(2), 68. Doi:10.1088/0004-637X/735/2/68.

Methods

extract(**kwargs)
fit(magnitude)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude)[source]

feets.extractors.ext_skew module

class feets.extractors.ext_skew.Skew(**cparams)[source]

Bases: feets.extractors.core.Extractor

Skew

The skewness of a sample is defined as follow:

\[Skewness = \frac{N}{(N-1)(N-2)} \sum_{i=1}^N (\frac{m_i-\hat{m}}{\sigma})^3\]

Example:

For a normal distribution it should be equal to zero:

>>> fs = feets.FeatureSpace(only=['Skew'])
>>> features, values = fs.extract(**lc_normal)
>>> dict(zip(features, values))
{'Skew': -0.00023325826785278685}

References

[richards2011machine6061]Richards, J. W., Starr, D. L., Butler, N. R., Bloom, J. S., Brewer, J. M., Crellin-Quick, A., … & Rischard, M. (2011). On machine-learned classification of variable stars with sparse and noisy time-series data. The Astrophysical Journal, 733(1), 10. Doi:10.1088/0004-637X/733/1/10.

Methods

extract(**kwargs)
fit(magnitude)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude)[source]

feets.extractors.ext_slotted_a_length module

class feets.extractors.ext_slotted_a_length.SlottedA_length(**cparams)[source]

Bases: feets.extractors.core.Extractor

SlottedA_length - Slotted Autocorrelation

In slotted autocorrelation, time lags are defined as intervals or slots instead of single values. The slotted autocorrelation function at a certain time lag slot is computed by averaging the cross product between samples whose time differences fall in the given slot.

\[\hat{\rho}(\tau=kh) = \frac {1}{\hat{\rho}(0)\,N_\tau} \sum_{t_i}\sum_{t_j= t_i+(k-1/2)h }^{t_i+(k+1/2)h} \bar{y}_i(t_i)\,\, \bar{y}_j(t_j)\]

Where \(h\) is the slot size, \(\bar{y}\) is the normalized magnitude, \(\hat{\rho}(0)\) is the slotted autocorrelation for the first lag, and \(N_\tau\) is the number of pairs that fall in the given slot.

>>> fs = feets.FeatureSpace(
...     only=['SlottedA_length'], SlottedA_length={"t": 1})
>>> features, values = fs.extract(**lc_normal)
>>> dict(zip(features, values))
{'SlottedA_length': 1.}

Parameters

  • T: tau - slot size in days (default=1).

References

[huijse2012information6263]Huijse, P., Estevez, P. A., Protopapas, P., Zegers, P., & Principe, J. C. (2012). An information theoretic algorithm for finding periodicities in stellar light curves. IEEE Transactions on Signal Processing, 60(10), 5135-5145.

Methods

extract(**kwargs)
fit(magnitude, time, T)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
slotted_autocorrelation(data, time, T, K[, …])
start_conditions(magnitude, time, T)
teardown() This method will be executed after the feature is calculated
fit(magnitude, time, T)[source]
slotted_autocorrelation(data, time, T, K, second_round=False, K1=100)[source]
start_conditions(magnitude, time, T)[source]

feets.extractors.ext_small_kurtosis module

class feets.extractors.ext_small_kurtosis.SmallKurtosis(**cparams)[source]

Bases: feets.extractors.core.Extractor

SmallKurtosis

Small sample kurtosis of the magnitudes.

\[SmallKurtosis = \frac{N (N+1)}{(N-1)(N-2)(N-3)} \sum_{i=1}^N (\frac{m_i-\hat{m}}{\sigma})^4 - \frac{3( N-1 )^2}{(N-2) (N-3)}\]

For a normal distribution, the small kurtosis should be zero:

>>> fs = feets.FeatureSpace(only=['SmallKurtosis'])
>>> features, values = fs.extract(**lc_normal)
>>> dict(zip(features, values))
{'SmallKurtosis': 0.044451779515607193}

See http://www.xycoon.com/peakedness_small_sample_test_1.htm

References

[richards2011machine6465]Richards, J. W., Starr, D. L., Butler, N. R., Bloom, J. S., Brewer, J. M., Crellin-Quick, A., … & Rischard, M. (2011). On machine-learned classification of variable stars with sparse and noisy time-series data. The Astrophysical Journal, 733(1), 10. Doi:10.1088/0004-637X/733/1/10.

Methods

extract(**kwargs)
fit(magnitude)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude)[source]

feets.extractors.ext_std module

class feets.extractors.ext_std.Std(**cparams)[source]

Bases: feets.extractors.core.Extractor

Std - Standard deviation of the magnitudes

The standard deviation \(\sigma\) of the sample is defined as:

\[\sigma=\frac{1}{N-1}\sum_{i} (y_{i}-\hat{y})^2\]

For example, a white noise time serie should have \(\sigma=1\)

>>> fs = feets.FeatureSpace(only=['Std'])
>>> features, values = fs.extract(**lc_normal)
>>> dict(zip(features, values))
{'Std': 0.99320419310116881}

References

[richards2011machine6667]Richards, J. W., Starr, D. L., Butler, N. R., Bloom, J. S., Brewer, J. M., Crellin-Quick, A., … & Rischard, M. (2011). On machine-learned classification of variable stars with sparse and noisy time-series data. The Astrophysical Journal, 733(1), 10. Doi:10.1088/0004-637X/733/1/10.

Methods

extract(**kwargs)
fit(magnitude)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude)[source]

feets.extractors.ext_stetson module

These three features are based on the Welch/Stetson variability index \(I\) (Stetson, 1996) defined by the equation:

\[I = \sqrt{\frac{1}{n(n-1)}} \sum_{i=1}^n { (\frac{b_i-\hat{b}}{\sigma_{b,i}}) (\frac{v_i - \hat{v}}{\sigma_{v,i}})}\]

where :math:b_i and \(v_i\) are the apparent magnitudes obtained for the candidate star in two observations closely spaced in time on some occasion \(i\), \(\sigma_{b, i}\) and \(\sigma_{v, i}\) are the standard errors of those magnitudes, \(\hat{b}\) and hat{v} are the weighted mean magnitudes in the two filters, and \(n\) is the number of observation pairs.

Since a given frame pair may include data from two filters which did not have equal numbers of observations overall, the “relative error” is calculated as follows:

\[\delta = \sqrt{\frac{n}{n-1}} \frac{v-\hat{v}}{\sigma_v}\]

allowing all residuals to be compared on an equal basis.

class feets.extractors.ext_stetson.StetsonJ(**cparams)[source]

Bases: feets.extractors.core.Extractor

These three features are based on the Welch/Stetson variability index \(I\) (Stetson, 1996) defined by the equation:

\[I = \sqrt{\frac{1}{n(n-1)}} \sum_{i=1}^n { (\frac{b_i-\hat{b}}{\sigma_{b,i}}) (\frac{v_i - \hat{v}}{\sigma_{v,i}})}\]

where :math:b_i and \(v_i\) are the apparent magnitudes obtained for the candidate star in two observations closely spaced in time on some occasion \(i\), \(\sigma_{b, i}\) and \(\sigma_{v, i}\) are the standard errors of those magnitudes, \(\hat{b}\) and hat{v} are the weighted mean magnitudes in the two filters, and \(n\) is the number of observation pairs.

Since a given frame pair may include data from two filters which did not have equal numbers of observations overall, the “relative error” is calculated as follows:

\[\delta = \sqrt{\frac{n}{n-1}} \frac{v-\hat{v}}{\sigma_v}\]

allowing all residuals to be compared on an equal basis.

StetsonJ

Stetson J is a robust version of the variability index. It is calculated based on two simultaneous light curves of a same star and is defined as:

\[J = \sum_{k=1}^n sgn(P_k) \sqrt{|P_k|}\]

with \(P_k = \delta_{i_k} \delta_{j_k}\)

For a Gaussian magnitude distribution, J should take a value close to zero:

>>> fs = feets.FeatureSpace(only=['StetsonJ'])
>>> features, values = fs.extract(**lc_normal)
>>> dict(zip(features, values))
{'StetsonJ': 0.010765631555204736}

Warning

The original FATS documentation says that the result of StetsonJ must be ~0 for gausian distribution but the result is ~-0.41

References

[richards2011machine6872]Richards, J. W., Starr, D. L., Butler, N. R., Bloom, J. S., Brewer, J. M., Crellin-Quick, A., … & Rischard, M. (2011). On machine-learned classification of variable stars with sparse and noisy time-series data. The Astrophysical Journal, 733(1), 10. Doi:10.1088/0004-637X/733/1/10.

Methods

extract(**kwargs)
fit(aligned_magnitude, aligned_magnitude2, …)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(aligned_magnitude, aligned_magnitude2, aligned_error, aligned_error2)[source]
class feets.extractors.ext_stetson.StetsonK(**cparams)[source]

Bases: feets.extractors.core.Extractor

These three features are based on the Welch/Stetson variability index \(I\) (Stetson, 1996) defined by the equation:

\[I = \sqrt{\frac{1}{n(n-1)}} \sum_{i=1}^n { (\frac{b_i-\hat{b}}{\sigma_{b,i}}) (\frac{v_i - \hat{v}}{\sigma_{v,i}})}\]

where :math:b_i and \(v_i\) are the apparent magnitudes obtained for the candidate star in two observations closely spaced in time on some occasion \(i\), \(\sigma_{b, i}\) and \(\sigma_{v, i}\) are the standard errors of those magnitudes, \(\hat{b}\) and hat{v} are the weighted mean magnitudes in the two filters, and \(n\) is the number of observation pairs.

Since a given frame pair may include data from two filters which did not have equal numbers of observations overall, the “relative error” is calculated as follows:

\[\delta = \sqrt{\frac{n}{n-1}} \frac{v-\hat{v}}{\sigma_v}\]

allowing all residuals to be compared on an equal basis.

StetsonK

Stetson K is a robust kurtosis measure:

\[\frac{1/N \sum_{i=1}^N |\delta_i|}{\sqrt{1/N \sum_{i=1}^N \delta_i^2}}\]

where the index \(i\) runs over all \(N\) observations available for the star without regard to pairing. For a Gaussian magnitude distribution K should take a value close to \(\sqrt{2/\pi} = 0.798\):

>>> fs = feets.FeatureSpace(only=['StetsonK'])
>>> features, values = fs.extract(**lc_normal)
>>> dict(zip(features, values))
{'StetsonK': 0.79914938521401002}

Warning

The original FATS documentation says that the result of StetsonK must be 2/pi=0.798 for gausian distribution but the result is ~0.2

References

[richards2011machine6973]Richards, J. W., Starr, D. L., Butler, N. R., Bloom, J. S., Brewer, J. M., Crellin-Quick, A., … & Rischard, M. (2011). On machine-learned classification of variable stars with sparse and noisy time-series data. The Astrophysical Journal, 733(1), 10. Doi:10.1088/0004-637X/733/1/10.

Methods

extract(**kwargs)
fit(magnitude, error)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude, error)[source]
class feets.extractors.ext_stetson.StetsonKAC(**cparams)[source]

Bases: feets.extractors.core.Extractor

These three features are based on the Welch/Stetson variability index \(I\) (Stetson, 1996) defined by the equation:

\[I = \sqrt{\frac{1}{n(n-1)}} \sum_{i=1}^n { (\frac{b_i-\hat{b}}{\sigma_{b,i}}) (\frac{v_i - \hat{v}}{\sigma_{v,i}})}\]

where :math:b_i and \(v_i\) are the apparent magnitudes obtained for the candidate star in two observations closely spaced in time on some occasion \(i\), \(\sigma_{b, i}\) and \(\sigma_{v, i}\) are the standard errors of those magnitudes, \(\hat{b}\) and hat{v} are the weighted mean magnitudes in the two filters, and \(n\) is the number of observation pairs.

Since a given frame pair may include data from two filters which did not have equal numbers of observations overall, the “relative error” is calculated as follows:

\[\delta = \sqrt{\frac{n}{n-1}} \frac{v-\hat{v}}{\sigma_v}\]

allowing all residuals to be compared on an equal basis.

StetsonK_AC

Stetson K applied to the slotted autocorrelation function of the light-curve.

>>> fs = feets.FeatureSpace(only=['SlottedA_length','StetsonK_AC'])
>>> features, values = fs.extract(**lc_normal)
>>> dict(zip(features, values))
{'SlottedA_length': 1.0, 'StetsonK_AC': 0.20917402545294403}

Parameters

  • T: tau - slot size in days (default=1).

References

[kim2011quasi7074]Kim, D. W., Protopapas, P., Byun, Y. I., Alcock, C., Khardon, R., & Trichas, M. (2011). Quasi-stellar object selection algorithm using time variability and machine learning: Selection of 1620 quasi-stellar object candidates from MACHO Large Magellanic Cloud database. The Astrophysical Journal, 735(2), 68. Doi:10.1088/0004-637X/735/2/68.

Methods

extract(**kwargs)
fit(magnitude, time, error, T)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude, time, error, T)[source]
class feets.extractors.ext_stetson.StetsonL(**cparams)[source]

Bases: feets.extractors.core.Extractor

These three features are based on the Welch/Stetson variability index \(I\) (Stetson, 1996) defined by the equation:

\[I = \sqrt{\frac{1}{n(n-1)}} \sum_{i=1}^n { (\frac{b_i-\hat{b}}{\sigma_{b,i}}) (\frac{v_i - \hat{v}}{\sigma_{v,i}})}\]

where :math:b_i and \(v_i\) are the apparent magnitudes obtained for the candidate star in two observations closely spaced in time on some occasion \(i\), \(\sigma_{b, i}\) and \(\sigma_{v, i}\) are the standard errors of those magnitudes, \(\hat{b}\) and hat{v} are the weighted mean magnitudes in the two filters, and \(n\) is the number of observation pairs.

Since a given frame pair may include data from two filters which did not have equal numbers of observations overall, the “relative error” is calculated as follows:

\[\delta = \sqrt{\frac{n}{n-1}} \frac{v-\hat{v}}{\sigma_v}\]

allowing all residuals to be compared on an equal basis.

StetsonL

Stetson L variability index describes the synchronous variability of different bands and is defined as:

\[L = \frac{JK}{0.798}\]

Again, for a Gaussian magnitude distribution, L should take a value close to zero:

>>> fs = feets.FeatureSpace(only=['SlottedL'])
>>> features, values = fs.extract(**lc_normal)
>>> dict(zip(features, values))
{'StetsonL': 0.0085957106316273714}

References

[kim2011quasi7175]Kim, D. W., Protopapas, P., Byun, Y. I., Alcock, C., Khardon, R., & Trichas, M. (2011). Quasi-stellar object selection algorithm using time variability and machine learning: Selection of 1620 quasi-stellar object candidates from MACHO Large Magellanic Cloud database. The Astrophysical Journal, 735(2), 68. Doi:10.1088/0004-637X/735/2/68.

Methods

extract(**kwargs)
fit(aligned_magnitude, aligned_magnitude2, …)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(aligned_magnitude, aligned_magnitude2, aligned_error, aligned_error2)[source]

feets.extractors.ext_structure_functions module

class feets.extractors.ext_structure_functions.StructureFunctions(**cparams)[source]

Bases: feets.extractors.core.Extractor

The structure function of rotation measures (RMs) contains information on electron density and magnetic field fluctuations.

References

[simonetti1984small7677]Simonetti, J. H., Cordes, J. M., & Spangler, S. R. (1984). Small-scale variations in the galactic magnetic field-The rotation measure structure function and birefringence in interstellar scintillations. The Astrophysical Journal, 284, 126-134.

Methods

extract(**kwargs)
fit(magnitude, time)
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
fit(magnitude, time)[source]

Module contents

Features extractors classes and register utilities

feets.extractors.register_extractor(cls)[source]
feets.extractors.registered_extractors()[source]
feets.extractors.is_registered(obj)[source]
feets.extractors.available_features()[source]
feets.extractors.extractor_of(feature)[source]
feets.extractors.sort_by_dependencies(exts, retry=None)[source]

Calculate the Feature Extractor Resolution Order.

exception feets.extractors.ExtractorBadDefinedError[source]

Bases: Exception

The extractor are not properly defined.

exception feets.extractors.ExtractorContractError[source]

Bases: ValueError

The extractor dont get the expected features, data, parameters or wathever.

exception feets.extractors.ExtractorWarning[source]

Bases: UserWarning

Warn about the Extractor behavior.

class feets.extractors.Extractor(**cparams)[source]

Bases: object

Methods

extract(**kwargs)
fit()
get_data()
get_default_params()
get_dependencies()
get_features()
get_warnings()
has_warnings()
setup() This method will be executed before the feature is calculated
teardown() This method will be executed after the feature is calculated
extract(**kwargs)[source]
fit()[source]
classmethod get_data()[source]
classmethod get_default_params()[source]
classmethod get_dependencies()[source]
classmethod get_features()[source]
classmethod get_warnings()[source]
classmethod has_warnings()[source]
setup()[source]

This method will be executed before the feature is calculated

teardown()[source]

This method will be executed after the feature is calculated