Code Monkey home page Code Monkey logo

exoplanet-classifier's Introduction

PyTorch Exoplanet Classifier

This project uses PyTorch to classify exoplanets based on their mass, radius, and density. The dataset used for this project was provided by NASA's Exoplanet Archive.

This is my first PyTorch and deep learning project. Exoplanet classification predictions made by this model may or may not be correct due to limited training data. This project is solely for educational and demonstration purposes.

DataLoader

The DataLoader.py file defines the ExoplanetDataset class, which loads the data from a CSV file and normalizes the input features (planet mass, radius, and density). The __getitem__ method returns a tuple containing the input features and target label for each data point. If the dataset is used for testing, only the input features are returned.

Exoplanet Classifier

The ExoplanetClassifier.py file defines the ExoplanetClassifier class, which is a fully connected neural network model. The number of layers, input size, hidden size, and output size can be configured as input arguments when creating an instance of the model.

The model is trained using the train_loader and val_loader created from the ExoplanetDataset class. The training process includes the following steps:

  • Forward pass through the model to obtain the predicted labels

  • Calculate the loss between the predicted and true labels using cross entropy loss

  • Backward pass through the model to calculate the gradients of the loss with respect to the model parameters

  • Update the model parameters using the optimizer (Adam optimizer is used in this project)

The model is evaluated on the validation set after each epoch of training. The validation process includes the following steps:

  • Forward pass through the model to obtain the predicted labels

  • Calculate the loss between the predicted and true labels using cross entropy loss

  • Calculate the accuracy of the model by comparing the predicted labels with the true labels

The trained model is saved to a file named exoplanet_classifier.pth using the torch.save function.

How to Use

To run the exoplanet classifier on a local machine, follow these steps:

  1. Clone the repository to your local machine using the following command:

    git clone https://github.com/jarvisar/exoplanet-classifier.git

  2. Change directory into the root folder of the cloned repository:

    cd exoplanet-classifier

  3. Configure the training set exoplanet_data.csv.

  4. Run the main.py file to start the classifier:

    python main.py

  5. Next, enter exoplanet parameters in the format "mass Re,radius Me,density g/cm3" to classify the exoplanet:

    >> 250,13.9,0.512

    jovian

Known Issues & Limitations

The training data used in this project is limited due to the difficulty of manually gathering exoplanet data and correctly classifying it. As a result, the model's performance may be limited by the small dataset size.

This project is intended to serve as a demonstration of PyTorch and deep learning techniques for exoplanet classification. It was undertaken as a personal interest project to develop my skills in PyTorch and deep learning. The project demonstrates proficiency in Python and my ability to implement a fully connected neural network model for exoplanet classification. Even though the training dataset used in this project is limited, the techniques used and the models developed in this project provide a strong foundation for further exploration and analysis in the future.


exoplanet-classifier's People

Contributors

jarvisar avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.