Projects

Automated Stellar Classification

An end-to-end exploration of predicting a star's spectral class from its physical properties.

GitHub
Python Scikit-learn Pandas NumPy Matplotlib

What I wanted to explore

I used this project to work through a complete multiclass classification problem with scientific data: understand the observations, prepare them for modeling, compare several approaches, and choose a model using more than one evaluation metric.

The target is a star's spectral class—O, B, A, F, G, K, or M. The model works from measurements such as temperature, luminosity, radius, absolute magnitude, and observed color.

Preparing the data

The notebooks separate the work into cleaning, preprocessing, exploration, and modeling. I inspected the distribution of spectral classes, normalized inconsistent color labels, and checked the dataset for missing values before turning it into model-ready features.

Temperature, luminosity, and radius are log-transformed, the numeric columns are scaled, and star colors are one-hot encoded. Keeping those steps explicit made it easier to see how the original astronomical measurements became inputs to the classifier.

Choosing the model

I compared a Random Forest with a support-vector machine, k-nearest neighbors, and a single decision tree. Each model went through randomized hyperparameter search with five-fold cross-validation and was evaluated using accuracy, macro precision, and macro F1.

K-nearest neighbors produced the higher raw accuracy in the notebook's comparison, but the Random Forest offered the better balance of precision and F1. That tradeoff mattered more for a dataset where the classes were not represented evenly, so I used the Random Forest for the final classification report.

What I learned

The most useful part of the project was seeing how easily a single score can hide the shape of a multiclass problem. Comparing model families was helpful, but choosing between them required deciding what kind of mistakes mattered and reading precision and recall alongside accuracy.