Light Curve Classifier Library
Installing late_classifier
From PyPI stable version:
pip install numpy Cython
pip install -e git+https://git@github.com/alercebroker/turbo-fats#egg=turbofats
pip install -e git+https://git@github.com/alercebroker/mhps#egg=mhps
pip install -e git+https://git@github.com/alercebroker/P4J#egg=P4J
pip install lc-classifier
For development:
git clone https://github.com/alercebroker/lc_classifier.git
python -m pip install -e .
How to use the library?
Check the available Jupyter notebooks in the examples directory.
Functionalities
Feature computation
This library provides an extensive number of feature extractors for astronomical light curves, including period computation, autoregresive models, parametric models, statistical features, etc. We also provide tools to transform your data into the format that this library expects (Pandas dataframes).
Augmentation
If you want more samples you can use our ShortTransientAugmenter class. More data augmentation techniques will be implemented in further releases.
Classifier
Two classifiers are available: A traditional Random Forest model, and a hierarchical model made from 4 Random Forest classifiers.
Preprocessing for ZTF data:
Before computing features, we preprocess the time series with filters and boundary conditions:
- Drop duplicate observations.
- Discard noisy detections.
- Discard bogus.
- Filter time series with more than 5 detections.
- Discard invalid values (like nans and infinite).
How can I add my own feature extractors to the library?
Feature extractors extend the following classes:
FeatureExtractorFeatureExtractorSingleBand. This type of feature extractor runs independently on each available band.
Check out the existent feature extractors in the directory lc_classifier/features/extractors.
Profile functionalities
The easiest way to profile a step is using cProfile, for this we just have to run the step with the following command:
python -m cProfile -o <outputfile> profiling/<functionality>.py
After that you can run snakeviz (first install it).
snakeviz <outputfile>
Test functionalities
You must first install the following packages:
pip install coverage pytest
All scripts of tests must be in tests folder. For run all tests:
coverage run --source lc_classifier -m pytest -x -s tests/
If you want run a specify functionality you can run:
coverage run --source lc_classifier -m pytest -x -s tests/<functionality>
After that you can see a report of tests:
coverage report
Run a container
This repository comes with a Dockerfile to test the model.
To build the image run
docker build -t alerce/lc_classifier
Then run the container
docker run --rm -p 8888:8888 alerce/lc_classifier
The container comes with a jupyter notebook and some examples in http://localhost:8888
Reference
If you use this library, please cite our work:
@inproceedings{sanchez2020alert,
title={Alert Classification for the ALeRCE Broker System: The Light Curve Classifier},
author={S{\'a}nchez-S{\'a}ez, P and Reyes, I and Valenzuela, C and F{\"o}rster, F and Eyheramendy, S and Elorrieta, F and Bauer, FE and Cabrera-Vives, G and Est{\'e}vez, PA and Catelan, M and others},
year={2020}
}
Metadata
Release files for lc-classifier 2.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lc_classifier-2.0.3.tar.gz | 3.7 kB | Without provenance | Details for lc_classifier-2.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lc_classifier-2.0.3-py3-none-any.whl | Python 3 | none | any | Details for lc_classifier-2.0.3-py3-none-any.whl |
Total release size: 7.6 kB
Release files / lc_classifier-2.0.3.tar.gz
| Download URL | lc_classifier-2.0.3.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
39f19be44fd4858cb5ed3df828db4744c647884bf2b37c35efe0828b50fd1810
|
|
BLAKE2b-256 checksum How to use checksums |
4addb837d23b3950b5d379fb53da2dd14fe10c6c71fb188ea5cca0492cab06db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
|
Release files / lc_classifier-2.0.3-py3-none-any.whl
| Download URL | lc_classifier-2.0.3-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ca74a0fac76b6082b1a89dd3eeccbde14470cd6eda002173ef4d30ba69bbddac
|
|
BLAKE2b-256 checksum How to use checksums |
dad6bb886961f0b35886758d525182260dbc54fa5ad869a50bc695b6922d5672
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
|
Security for lc-classifier 2.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.