Skip to content

404Avinash/stellar

Repository files navigation

Stellar Verification Program - Exoplanet Prediction System.

A comprehensive end-to-end machine learning system for classifying exoplanets and predicting planetary radius using Kepler Objects of Interest (KOI) data.

🌟 Project Overview

The Stellar Verification Program uses advanced machine learning to:

  1. Classify KOI signals - Distinguish confirmed exoplanets from false positives
  2. Predict planetary radius - Estimate the planetary radius in Earth radii

πŸ“‹ Project Structure

Stellar/
β”œβ”€β”€ frontend/              # React.js web application
β”‚   β”œβ”€β”€ public/           # Static assets
β”‚   β”œβ”€β”€ src/              # React components
β”‚   β”‚   β”œβ”€β”€ components/   # Reusable components
β”‚   β”‚   β”œβ”€β”€ App.js        # Main app component
β”‚   β”‚   └── App.css       # Styling
β”‚   └── package.json      # Frontend dependencies
β”œβ”€β”€ backend/              # Flask REST API
β”‚   β”œβ”€β”€ app.py           # Main Flask application
β”‚   └── requirements.txt  # Python dependencies
β”œβ”€β”€ ml_pipeline/          # ML models and pipeline
β”‚   β”œβ”€β”€ preprocessing.py  # Data preprocessing
β”‚   β”œβ”€β”€ inference.py      # Model inference
β”‚   β”œβ”€β”€ training.py       # Model training
β”‚   └── eda.py           # Exploratory Data Analysis
β”œβ”€β”€ data/                 # Data directory (add your dataset here)
└── README.md             # This file

πŸš€ Getting Started

Prerequisites

  • Python 3.8+
  • Node.js 14+
  • PostgreSQL or SQLite

Backend Setup

  1. Navigate to backend directory:
cd backend
  1. Create Python virtual environment:
python -m venv venv
source venv/Scripts/activate  # On Windows
  1. Install dependencies:
pip install -r requirements.txt
  1. Run Flask server:
python app.py

The API will be available at http://localhost:5000

Frontend Setup

  1. Navigate to frontend directory:
cd frontend
  1. Install dependencies:
npm install
  1. Start development server:
npm start

The application will open at http://localhost:3000

πŸ“Š API Endpoints

Prediction

  • POST /api/predict - Get classification and regression predictions
    {
      "koi_period": 10.5,
      "koi_impact": 0.5,
      "koi_duration": 5.2,
      "koi_depth": 500,
      "koi_steff": 5778,
      "koi_srad": 1.0,
      "koi_smass": 1.0
    }

History & Statistics

  • GET /api/predictions - Get all predictions
  • GET /api/predictions/<id> - Get specific prediction
  • GET /api/statistics - Get aggregated statistics
  • GET /api/health - Health check

πŸ€– ML Pipeline

Data Preprocessing

  • Handles missing values through imputation
  • Feature normalization using StandardScaler
  • Feature engineering for composite metrics

Model Architecture

  • Classification: Random Forest Classifier

    • Metric: F1-score, ROC-AUC
  • Regression: Random Forest Regressor

    • Metric: RMSE, MAE

🎯 Features

Frontend

βœ… Input validation with immediate feedback βœ… Interactive prediction interface βœ… Real-time visualization of results βœ… Prediction history tracking βœ… Statistical analytics dashboard βœ… Responsive design

Backend

βœ… RESTful API with CORS support βœ… Input validation and preprocessing βœ… Real-time model inference βœ… Prediction history in database βœ… Statistical aggregation

πŸ“ˆ Performance Metrics

Classification Performance

  • F1-Score: Measures precision and recall balance
  • ROC-AUC: Area under the receiver operating characteristic curve

Regression Performance

  • RMSE: Root Mean Squared Error
  • MAE: Mean Absolute Error

πŸ”§ Configuration

Create a .env file in the backend directory:

FLASK_ENV=development
FLASK_DEBUG=1
DATABASE_URL=sqlite:///exoplanet_predictions.db

πŸ“š Data Requirements

The system expects the following features:

  • koi_period - Orbital period (days)
  • koi_impact - Impact parameter
  • koi_duration - Transit duration (hours)
  • koi_depth - Transit depth (ppm)
  • koi_steff - Star effective temperature (K)
  • koi_srad - Star radius (solar radii)
  • koi_smass - Star mass (solar masses)

Target variables:

  • koi_disposition - Classification target (CONFIRMED/FALSE POSITIVE)
  • koi_prad - Planetary radius (Earth radii)

πŸ§ͺ Testing

Run the frontend tests:

cd frontend
npm test

πŸ› Troubleshooting

CORS Issues

If you encounter CORS errors, ensure the Flask backend is running and accessible at http://localhost:5000

Database Issues

Delete exoplanet_predictions.db and restart the Flask app to reset the database

Port Already in Use

  • Flask: Change port in app.py to a different port
  • React: Use PORT=3001 npm start

πŸ“ Documentation

See ml_pipeline/README.md for detailed ML pipeline documentation.

πŸ‘₯ Team

TEAM : RUSTY. Avinash Jha Ayush Belwal Ayush Kirti Singh

πŸ“„ License

[Add license information]

About

End-to-end ML pipeline with EDA, model training, and full-stack deployment - production-grade data science with Python and Jupyter

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors