SCMF
Supernova Classification with Machine Learning and FPCA
SCMF is a Python package for binary photometric classification of transients to identify Type Ia supernovae (SNe Ia) using Functional Principal Component Analysis (FPCA) for light curve fitting and Gradient Boosting Decision Trees for classification. Given a set of light curves, SCMF outputs a file identifying potential SNe Ia candidates.
What is FPCA?
Functional Principal Component Analysis (FPCA) is a data-driven decomposition method that represents light curves as a linear combination of weighted eigenvectors in the phase space:
g(q) = m + φ_0(q) + a_1*φ_1(q) + a_2*φ_2(q)
where m is a fitted parameter representing the apparent peak magnitude, φ_0, φ_1, φ_2 are the mean template and principal eigenvectors learned from a training set of SNe Ia light curves, and a_1, a_2 are the FPCA scores that characterize each individual light curve (He et al. 2018).
Fitting light curves
- Multi-band FPCA light curve fitting using Levenberg-Marquardt optimization (mpfit)
- Redshift-dependent priors on FPCA scores
- Peak time consistency enforced across all filters
- Supports grizy photometric bands
- Designed for LSST/Rubin and DES data
Classification
- Features used for classification are the FPCA scores in the available photometric bands and m converted to absolute magnitudes assuming a fixed cosmology.
- CatBoost is used as the base classifier within a majority-vote ensemble (n_runs, min_votes, and threshold are adjustable).
Installation
pip install scmf
Repository
https://github.com/MoonzarinReza/scmf
Example
A full worked example is available in the [example notebook] https://github.com/MoonzarinReza/scmf/blob/master/scmf/example/example.ipynb
Usage
Step 1: Fit Light Curves
from scmf import fit_lc
fit_lc(lc_dir = '/path/to/lightcurves')
Parameters
lc_dir : str, required Root directory containing the light curve CSV files. Each CSV file corresponds to one transient and must contain the following columns: mjd, mag, magerr, filter, redshift, name.
num_attempts : int, optional Number of times the best-fit parameters are determined; the optimum solution is selected based on the minimum chi-square value. Default is 3.
Outputs:
- raw.csv : per-filter fit results
- wide.csv : wide format (one row per SN)
- final_fpca_data.csv : same as wide.csv except that apparent magnitudes are replaced by absolute magnitudes, ready for classification
Step 2: Classify
from scmf import classify
classify(n_runs = 5, min_votes = 3, threshold = 0.5)
Parameters
n_runs : int, optional Number of times the experiment is repeated. Default is 5.
min_votes : int, optional Minimum number of runs that must predict SNe Ia for a transient to be accepted as a candidate. Default is 3.
threshold : float, optional Predicted probability above which a transient is determined as SNe Ia in a given run. Must be between 0 and 1. Default is 0.5.
Outputs:
- potential_SNIa_candidates.csv : names and redshifts of SNIa candidates
Dependencies
- numpy, pandas, scipy, matplotlib
- astropy, catboost, scikit-learn
Author
Moonzarin Reza, Texas A&M University
Citation
If you use SCMF in your research, please cite:
Reza, M., Wang, L., & Hu, L. (2025). An FPCA-Enhanced Ensemble Learning Framework for Photometric Identification of Type Ia Supernovae, arXiv:2510.09990.
Metadata
Release files for scmf 0.1.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 |
|---|---|---|---|---|
| scmf-0.1.3.tar.gz | 1.6 MB | Without provenance | Details for scmf-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scmf-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for scmf-0.1.3-py3-none-any.whl |
Total release size: 3.2 MB
Release files / scmf-0.1.3.tar.gz
| Download URL | scmf-0.1.3.tar.gz |
|---|---|
| Size | 1.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a932ea3f3c3f0dfd0a8e12914023e36158aa1af7ad7ef303cbc022b2adfa277b
|
|
BLAKE2b-256 checksum How to use checksums |
f2ab822b9ff572b8a842d1661b0584c481caecbfa8710485d1db7c89a38265a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Release files / scmf-0.1.3-py3-none-any.whl
| Download URL | scmf-0.1.3-py3-none-any.whl |
|---|---|
| Size | 1.6 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e7836c39b18d0e8d750f08ca9176dbf23933c8004e2fefccca692635f979872d
|
|
BLAKE2b-256 checksum How to use checksums |
3a5aba452d6a904755f96c908755deba60ed73531be0cc3cf6d9b7b9057cf511
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Security for scmf 0.1.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.