This project aims to classify pulsars into different types based on their characteristic features, specifically the Pulse period (P0), Period derivative (P1), and Surface Magnetic Field (BSURF). The classification is performed using the Random Forest algorithm, a machine learning technique.
The dataset used in this project is obtained from the ATNF Pulsar Catalogue, containing information about pulsars' P0, P1, TYPE, and BSURF parameters.
AXP: Anomalous X-ray Pulsar or Soft Gamma-ray Repeater with detected pulsations
HE: Spin-powered pulsar with pulsed emission from radio to infrared or higher frequencies
NRAD: Spin-powered pulsar with pulsed emission only at infrared or higher frequencies
RRAT: Pulsars with intermittently pulsed radio emission
XINS: Isolated neutron stars with pulsed thermal X-ray emission but no detectable radio emission
- Python 3.x
- pandas
- numpy
- matplotlib
- scikit-learn
- Install the required dependencies using:
pip install pandas numpy matplotlib scikit-learn
- Run the project file:
python main.py
- The Random Forest classifier will be trained on the data, and predictions will be made on a test set.
- Accuracy and additional classification metrics will be displayed.
- Three plots will be generated and saved:
- Original Data
- Test Data
- Predicted Data
The Random Forest classifier achieves an accuracy of approximately 78%, indicating its effectiveness in classifying pulsar types based on the provided features.
Accuracy: 0.78
Type | Precision | Recall | F1-Score | Support |
---|---|---|---|---|
AXP | 0.88 | 1.00 | 0.93 | 7 |
HE | 0.84 | 0.82 | 0.83 | 68 |
NRAD | 0.56 | 0.48 | 0.51 | 21 |
RRAT | 0.79 | 1.00 | 0.88 | 11 |
XINS | 0.50 | 0.50 | 0.50 | 2 |
main.py
: Main script containing the implementation of the Random Forest classifier.data/data1.csv
: CSV file containing the ATNF Pulsar Catalogue data.README.md
: This file providing an overview of the project.
ATNF Pulsar Catalogue: Link to ATNF Pulsar Catalogue