This project was developed for the HydroSpark ML Quest, a challenge centered on predicting the exact time a burning candle will extinguish. Unlike standard "black-box" ML approaches, this repository utilizes Physical Logicβspecifically fluid dynamics and thermodynamicsβto engineer features that make predictions more stable and explainable.
A common pitfall in candle modeling is focusing solely on the vertical height drop. However, height change is dependent on the candle's diameter. To create a robust model, we shifted the focus to Volumetric Burn Rate (
-
Feature Engineering: We calculate the cross-sectional area (
$A$ ) using the diameter ($d$ ):$$A = \pi \cdot \left(\frac{d}{2}\right)^2$$ -
Universal Metric: We convert height measurements into Volume Consumed (
$V_c$ ):$$V_c = A \cdot (H_{initial} - H_{current})$$ - Modeling: We apply Linear and 2nd-Degree Polynomial Regression to the pooled volumetric data. This allows the model to generalize across different candle shapes and sizes, even if the specific wax type is unknown.
- Multi-Wax Support: Individual profiles for Paraffin, Soy, and Beeswax.
- Generalized Model: A pooled dataset approach that calculates a "Universal Volumetric Burn Rate" for mystery candles.
- Physics-Informed: Respects the material density and cross-sectional constraints of the physical setup.
- Visual Analysis: Includes
matplotlibvisualizations to track prediction curves vs. actual burn data.
- Language: Python 3.x
- ML Framework: Scikit-Learn (Linear & Polynomial Regression)
- Data Handling: NumPy
- Visualization: Matplotlib
The model successfully predicts extinction times for variable diameters (e.g., transitioning from a 20mm training candle to a 9mm test candle) by normalizing for the volumetric drop rate, significantly outperforming simple time-series height models.
βββ src/
β βββ main_prediction.py # The core modeling and prediction script
β βββ data_visualizer.py # Script for plotting burn curves
βββ data/
β βββ sample_measurements.csv # Training data for Paraffin, Soy, and Beeswax
βββ README.md # Project documentation
βββ requirements.txt # Necessary Python libraries