<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Alex Baker · Research Documentation Blog</title>
        <link>https://phd-brown.github.io/research-docs/Blog</link>
        <description>Alex Baker · Research Documentation Blog</description>
        <lastBuildDate>Fri, 01 Aug 2025 00:00:00 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <item>
            <title><![CDATA[From 32% to 84%: The Story of a Breakthrough in AI-Based Stellar Classification]]></title>
            <link>https://phd-brown.github.io/research-docs/Blog/2025-08-01-from-32-to-84-percent-stellar-classifier</link>
            <guid>https://phd-brown.github.io/research-docs/Blog/2025-08-01-from-32-to-84-percent-stellar-classifier</guid>
            <pubDate>Fri, 01 Aug 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[An astrophysics lesson: when feature engineering beats brute force.]]></description>
            <content:encoded><![CDATA[<p>The AstroSpectro project journey reached a major milestone today. What began as a modest baseline with <strong>32%</strong> accuracy has become, after a series of rigorous scientific iterations, a high-performance stellar classifier reaching <strong>84%</strong> accuracy. This post retraces the key steps, discoveries, and lessons learned along the way.</p>
<!-- -->
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="act-i-the-32-baseline--a-proof-of-concept">Act I: The 32% Baseline — A Proof of Concept<a href="https://phd-brown.github.io/research-docs/Blog/2025-08-01-from-32-to-84-percent-stellar-classifier#act-i-the-32-baseline--a-proof-of-concept" class="hash-link" aria-label="Direct link to Act I: The 32% Baseline — A Proof of Concept" title="Direct link to Act I: The 32% Baseline — A Proof of Concept" translate="no">​</a></h3>
<p>Our starting point was a simple model trained on 5,000 spectra with only four features: the presence or absence of the Hα, Hβ, and CaII H &amp; K lines. The result, 32%, was more than three times better than chance and validated our pipeline. However, analysing the results revealed two major weaknesses:</p>
<ol>
<li class="">a strong class imbalance,</li>
<li class="">features that were too often absent, especially Hα.</li>
</ol>
<p>(For more details, see my <a class="" href="https://phd-brown.github.io/research-docs/Blog/2025-07-22-premier-modele-baseline-32">first results post</a>).</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="act-ii-the-feature-engineering-era--toward-75">Act II: The Feature Engineering Era — Toward 75%<a href="https://phd-brown.github.io/research-docs/Blog/2025-08-01-from-32-to-84-percent-stellar-classifier#act-ii-the-feature-engineering-era--toward-75" class="hash-link" aria-label="Direct link to Act II: The Feature Engineering Era — Toward 75%" title="Direct link to Act II: The Feature Engineering Era — Toward 75%" translate="no">​</a></h3>
<p>The roadmap was clear: we needed to enrich our features. Each new idea was tested methodically:</p>
<ol>
<li class=""><strong>From Presence to Strength (Prominence):</strong> Measuring line depth raised accuracy to <strong>40%</strong>.</li>
<li class=""><strong>The Power of Ratios:</strong> Adding strength ratios between lines (e.g. CaII K / Hβ) pushed the score to <strong>50%</strong>.</li>
<li class=""><strong>Context Through Metadata:</strong> Including FITS header metadata (redshift, SNR, seeing) produced a spectacular breakthrough, reaching <strong>71%</strong>.</li>
<li class=""><strong>Line Shape (FWHM &amp; Skewness):</strong> Adding the <strong>full width at half maximum (FWHM)</strong> further refined the model. We also tested line <strong>asymmetry (skewness)</strong>. While FWHM proved to be a highly relevant indicator, skewness did not improve performance. The analysis showed that this measure was too sensitive to residual noise, even after smoothing, so the model learned to ignore it. This is an important lesson: not all physical features are necessarily useful for an AI model.</li>
<li class=""><strong>Robustness Through Cross-Validation:</strong> Integrating <code>GridSearchCV</code> made it possible to find the best hyperparameters and stabilize performance around a very solid <strong>75%</strong>.</li>
</ol>
<p>Each step confirmed the same principle: the more physical and contextual information we gave the model, the better it performed.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-key-tool-interactive-debugging">The Key Tool: Interactive Debugging<a href="https://phd-brown.github.io/research-docs/Blog/2025-08-01-from-32-to-84-percent-stellar-classifier#the-key-tool-interactive-debugging" class="hash-link" aria-label="Direct link to The Key Tool: Interactive Debugging" title="Direct link to The Key Tool: Interactive Debugging" translate="no">​</a></h3>
<p>This progress would not have been possible without the visualization tools developed in parallel. Our <a href="https://github.com/PhD-Brown/AstroSpectro/blob/main/notebooks/02_tools_and_visuals.ipynb" target="_blank" rel="noopener noreferrer" class="">Augmented Spectrum Analyzer</a> became the core of our research process, allowing us to:</p>
<ul>
<li class=""><strong>Visualize</strong> any spectrum in our collection.</li>
<li class=""><strong>Tune</strong> peak-detection parameters in real time.</li>
<li class=""><strong>Compare</strong> a star's “true” class with the model prediction live.</li>
</ul>
<p>This tool allowed us to identify that our initial detection parameters were too strict, causing us to miss crucial information.</p>
<p><img decoding="async" loading="lazy" alt="Screenshot of the Augmented Spectrum Analyzer" src="https://phd-brown.github.io/research-docs/assets/images/analyseur_spectre_final-12a6197f2e27bf2b41837b16c05a1c4a.png" width="1457" height="1484" class="img_ev3q"></p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="act-iii-the-xgboost-challenger--the-breakthrough-to-84">Act III: The XGBoost Challenger — The Breakthrough to 84%<a href="https://phd-brown.github.io/research-docs/Blog/2025-08-01-from-32-to-84-percent-stellar-classifier#act-iii-the-xgboost-challenger--the-breakthrough-to-84" class="hash-link" aria-label="Direct link to Act III: The XGBoost Challenger — The Breakthrough to 84%" title="Direct link to Act III: The XGBoost Challenger — The Breakthrough to 84%" translate="no">​</a></h3>
<p>With a rich and robust feature set, it was time to test a more powerful model. We replaced the <code>RandomForest</code> with <code>XGBoost</code>, a gradient boosting algorithm renowned for its performance.</p>
<p>The result was immediate and spectacular.</p>
<ul>
<li class=""><strong>Cross-Validation Score: 82.3%</strong></li>
<li class=""><strong>Final accuracy on the test set: 84%</strong></li>
</ul>
<details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>View the final results in detail</summary><div><div class="collapsibleContent_i85q"><div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#bfc7d5"><span class="token plain">--- Evaluation Report (XGBoost) ---</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">             precision  recall   f1-score   support</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">A              0.85      0.79      0.82        29</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">F              0.79      0.79      0.79        98</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">G              0.82      0.80      0.81       143</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">K              0.77      0.85      0.81       101</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">M              0.94      0.82      0.88        57</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">N              0.97      1.00      0.99        69</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">accuracy                           0.84       497</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">macro avg      0.86      0.84      0.85       497</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">weighted avg   0.84      0.84      0.84       497</span><br></div></code></pre></div></div><p><img decoding="async" loading="lazy" alt="Final Confusion Matrix" src="https://phd-brown.github.io/research-docs/assets/images/matrice_finale_xgboost-95d402b96d1e5364c4372b6f638c3cc0.png" width="1174" height="935" class="img_ev3q"></p></div></div></details>
<p>The final confusion matrix shows a dominant diagonal, the sign of an extremely confident and accurate model. Confusion between adjacent classes was minimized, and performance is excellent across all major stellar types.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="anatomy-of-the-decision-which-features-matter-most">Anatomy of the Decision: Which Features Matter Most?<a href="https://phd-brown.github.io/research-docs/Blog/2025-08-01-from-32-to-84-percent-stellar-classifier#anatomy-of-the-decision-which-features-matter-most" class="hash-link" aria-label="Direct link to Anatomy of the Decision: Which Features Matter Most?" title="Direct link to Anatomy of the Decision: Which Features Matter Most?" translate="no">​</a></h3>
<p>The feature-importance plot for our final XGBoost model reveals a fascinating hierarchy. Contextual metadata such as <code>redshift_error</code> and the colour index dominate, but they are immediately followed by the physical measurements we extracted, such as the width (FWHM) and strength (prominence) of the Hα and Hβ lines. This confirms that the best performance is achieved by combining the <strong>observational context</strong> with the <strong>physical properties of the spectrum</strong>.</p>
<p><img decoding="async" loading="lazy" alt="Final Feature Importance Plot" src="https://phd-brown.github.io/research-docs/assets/images/importance_features_final_xgboost-58a46098fa406dfb72e5ec3fa9bbdcb5.png" width="990" height="790" class="img_ev3q"></p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="conclusion-the-convergence-of-physics-and-ai">Conclusion: The Convergence of Physics and AI<a href="https://phd-brown.github.io/research-docs/Blog/2025-08-01-from-32-to-84-percent-stellar-classifier#conclusion-the-convergence-of-physics-and-ai" class="hash-link" aria-label="Direct link to Conclusion: The Convergence of Physics and AI" title="Direct link to Conclusion: The Convergence of Physics and AI" translate="no">​</a></h3>
<p>This journey from 32% to 84% is not just the story of an improving score. It demonstrates that a rigorous approach combining:</p>
<ul>
<li class="">A robust <strong>modular software architecture</strong>.</li>
<li class=""><strong>Feature engineering</strong> guided by astrophysical domain knowledge.</li>
<li class=""><strong>Interactive visualization tools</strong> for debugging and analysis.</li>
<li class=""><strong>Rigorous statistical validation</strong> of models.</li>
</ul>
<p>...can produce very high-quality results.</p>
<p>The AstroSpectro project has reached its main objective. The laboratory is built, the tools are sharpened, and the results are here. The adventure, of course, is only beginning. The <a class="" href="https://phd-brown.github.io/research-docs/docs/astrospectro/community/roadmap">Roadmap</a> is still full of exciting challenges.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="perspectives">Perspectives<a href="https://phd-brown.github.io/research-docs/Blog/2025-08-01-from-32-to-84-percent-stellar-classifier#perspectives" class="hash-link" aria-label="Direct link to Perspectives" title="Direct link to Perspectives" translate="no">​</a></h3>
<ul>
<li class=""><strong>New models to test</strong>: CNNs, spectral transformers.</li>
<li class=""><strong>Greater dataset diversity</strong>: extension to DR6, SDSS...</li>
<li class=""><strong>Full pipeline automation (CI/CD)</strong>.</li>
<li class=""><strong>Streamlit app</strong>: toward an online interactive classification interface.</li>
</ul>
<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id="-want-to-contribute">🚀 <em>Want to contribute?</em><a href="https://phd-brown.github.io/research-docs/Blog/2025-08-01-from-32-to-84-percent-stellar-classifier#-want-to-contribute" class="hash-link" aria-label="Direct link to -want-to-contribute" title="Direct link to -want-to-contribute" translate="no">​</a></h4>
<p>Fork the project, suggest your ideas, or <a class="" href="https://phd-brown.github.io/research-docs/docs/astrospectro/community/contributing">contact me</a>!</p>]]></content:encoded>
            <category>AstroSpectro</category>
            <category>results</category>
            <category>milestone</category>
            <category>machine-learning</category>
            <category>feature-engineering</category>
        </item>
        <item>
            <title><![CDATA[Anatomy of an Improvement]]></title>
            <link>https://phd-brown.github.io/research-docs/Blog/2025-07-24-anatomie-pipeline-dia-astrophysique</link>
            <guid>https://phd-brown.github.io/research-docs/Blog/2025-07-24-anatomie-pipeline-dia-astrophysique</guid>
            <pubDate>Thu, 24 Jul 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[How better feature extraction increased model performance from 32% to 56%.]]></description>
            <content:encoded><![CDATA[<p>I built a pipeline that models spectral classification based on the principles of stellar physics. The model autonomously learned that Calcium and Hydrogen line-strength ratios are the best temperature indicators, validating our feature engineering approach and allowing us to reach 56% accuracy.</p>
<!-- -->
<p>Today, after several iterations of debugging, analysis, and optimization, we reached a significant milestone, increasing the model accuracy from 32% to a very respectable <strong>56%</strong>. Here is the story of that progression.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="iteration-1-from-line-presence-to-line-strength">Iteration 1: From Line Presence to Line Strength<a href="https://phd-brown.github.io/research-docs/Blog/2025-07-24-anatomie-pipeline-dia-astrophysique#iteration-1-from-line-presence-to-line-strength" class="hash-link" aria-label="Direct link to Iteration 1: From Line Presence to Line Strength" title="Direct link to Iteration 1: From Line Presence to Line Strength" translate="no">​</a></h3>
<p>The first improvement consisted in moving from a binary feature (is the line present?) to a continuous measurement: the <strong>line strength</strong>, approximated by the "prominence" of the absorption peak. This change had an immediate impact, raising our overall accuracy from 32% to <strong>40%</strong>. This step confirmed that the amount of physical information contained in the strength of a line is much richer than its mere presence.</p>
<details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>View detailed results</summary><div><div class="collapsibleContent_i85q"><div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#bfc7d5"><span class="token plain">Removal of overly rare classes: ['C']</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">Features used for training: ['feature_Hα', 'feature_Hβ', 'feature_CaIIK', 'feature_CaIIH']</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">Number of samples: 4999, Number of features: 4</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">&gt; Training the model on 3749 samples...</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">&gt; Model trained.</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">--- Evaluation Report ---</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">            precision    recall  f1-score   support</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         A       0.58      0.64      0.61        73</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         B       0.00      0.00      0.00         1</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         D       0.00      0.00      0.00         1</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         F       0.43      0.43      0.43       255</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         G       0.43      0.35      0.38       394</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         K       0.34      0.49      0.40       283</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         M       0.28      0.18      0.22       158</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         N       0.43      0.51      0.46        84</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         W       0.00      0.00      0.00         1</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         s       0.00      0.00      0.00         0</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">  accuracy                           0.40      1250</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> macro avg       0.25      0.26      0.25      1250</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">weighted avg     0.40      0.40      0.40      1250</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></div></code></pre></div></div><p><img decoding="async" loading="lazy" alt="image info" src="https://phd-brown.github.io/research-docs/assets/images/matrice_02-9f241410732bcb06104120f31fbfa850.png" width="649" height="547" class="img_ev3q"></p></div></div></details>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="iteration-2-the-power-of-spectral-ratios">Iteration 2: The Power of Spectral Ratios<a href="https://phd-brown.github.io/research-docs/Blog/2025-07-24-anatomie-pipeline-dia-astrophysique#iteration-2-the-power-of-spectral-ratios" class="hash-link" aria-label="Direct link to Iteration 2: The Power of Spectral Ratios" title="Direct link to Iteration 2: The Power of Spectral Ratios" translate="no">​</a></h3>
<p>With a solid new baseline, we introduced even more sophisticated features: <strong>strength ratios between different lines</strong>. In astrophysics, these ratios are extremely powerful temperature indicators.</p>
<ul>
<li class=""><code>feature_ratio_CaK_Hbeta = CaII K / Hβ</code></li>
<li class=""><code>feature_ratio_Halpha_Hbeta = Hα / Hβ</code></li>
</ul>
<p>Adding just these two ratios once again pushed the model forward, reaching <strong>50%</strong> accuracy. The confusion matrix showed a clear improvement, but a feature-quality analysis revealed a critical weakness: the Hα line was missing in more than 50% of the spectra, making the ratios unreliable.</p>
<details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>View detailed results</summary><div><div class="collapsibleContent_i85q"><div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#bfc7d5"><span class="token plain">--- Loading dataset: features_20250723T225208Z.csv ---</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">&gt; 250 rows with invalid or null labels removed.</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">&gt; Removal of overly rare classes: ['W', 'C', 'D', 'B', 's']</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">Features used: ['feature_Hα', 'feature_Hβ', 'feature_CaIIK', 'feature_CaIIH', 'feature_ratio_CaK_Hbeta', 'feature_ratio_Halpha_Hbeta']</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">Final number of samples: 2740, Number of features: 6</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">--- STEP 5: Model Training and Evaluation ---</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">&gt; Training the model on 2055 samples...</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">&gt; Model trained.</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">--- Evaluation Report ---</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">            precision    recall  f1-score   support</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         A       0.70      0.51      0.59        41</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         F       0.54      0.60      0.57       157</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         G       0.55      0.58      0.56       230</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         K       0.41      0.40      0.41       163</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         M       0.34      0.29      0.31        94</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">  accuracy                           0.50       685</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> macro avg       0.51      0.48      0.49       685</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">weighted avg     0.49      0.50      0.49       685</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></div></code></pre></div></div><p><img decoding="async" loading="lazy" alt="image info" src="https://phd-brown.github.io/research-docs/assets/images/matrice_03-786d839dd9ebe4d453bba641743cfeb6.png" width="649" height="547" class="img_ev3q">
<img decoding="async" loading="lazy" alt="image info" src="https://phd-brown.github.io/research-docs/assets/images/zero_features_01-018bb87f13bef04ff95a6217a192b5be.png" width="1189" height="590" class="img_ev3q">
<img decoding="async" loading="lazy" alt="image info" src="https://phd-brown.github.io/research-docs/assets/images/importance_features_01-a0366e82ece8bc594d72b6d7295affe1.png" width="1189" height="590" class="img_ev3q"></p></div></div></details>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="final-iteration-tuning-through-visualization">Final Iteration: Tuning Through Visualization<a href="https://phd-brown.github.io/research-docs/Blog/2025-07-24-anatomie-pipeline-dia-astrophysique#final-iteration-tuning-through-visualization" class="hash-link" aria-label="Direct link to Final Iteration: Tuning Through Visualization" title="Direct link to Final Iteration: Tuning Through Visualization" translate="no">​</a></h3>
<p>At this stage, our visualization tools became crucial. The analysis showed that our peak-detection parameter (<code>prominence</code>) was too strict and ignored many real but shallower lines.</p>
<p>Thanks to our <strong>interactive spectrum analyzer</strong>, we were able to tune this parameter in real time. An optimized value of <code>prominence=0.23</code> was identified, allowing us to recover a large number of lines that had previously been ignored.</p>
<p><img decoding="async" loading="lazy" alt="image info" src="https://phd-brown.github.io/research-docs/assets/images/raie_01-bbdc5e14d8267ca5e911112f0984cd87.png" width="1474" height="817" class="img_ev3q">
<img decoding="async" loading="lazy" alt="image info" src="https://phd-brown.github.io/research-docs/assets/images/raie_02-83cca19ee4815f7fc89987da946426c8.png" width="1459" height="817" class="img_ev3q"></p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-final-result-56-accuracy">The Final Result: 56% Accuracy<a href="https://phd-brown.github.io/research-docs/Blog/2025-07-24-anatomie-pipeline-dia-astrophysique#the-final-result-56-accuracy" class="hash-link" aria-label="Direct link to The Final Result: 56% Accuracy" title="Direct link to The Final Result: 56% Accuracy" translate="no">​</a></h3>
<p>After rerunning the full pipeline with this optimized parameter on a new batch of <strong>2607 spectra</strong>, the results exceeded our expectations:</p>
<ul>
<li class=""><strong>Overall Accuracy: 56%</strong></li>
<li class=""><strong>Feature Quality:</strong> The missing-value problem was almost eliminated, with all base features present in more than <strong>95%</strong> of cases.</li>
<li class=""><strong>Feature Relevance:</strong> Feature importance is now much better balanced. <code>feature_Hβ</code> and the <code>ratio_CaK_Hbeta</code> stand out as the most powerful indicators, but all features now contribute meaningfully.</li>
</ul>
<p>The final confusion matrix shows a much clearer diagonal, a sign of a more confident and more accurate model, with F1 scores above 0.54 for all main classes.</p>
<details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>View detailed results</summary><div><div class="collapsibleContent_i85q"><div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#bfc7d5"><span class="token plain">--- Loading dataset: features_20250724T012617Z.csv ---</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">&gt; 383 rows with invalid or null labels removed.</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">&gt; Removal of overly rare classes: ['s', 'B', 'D', 'C']</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">Features used: ['feature_Hα', 'feature_Hβ', 'feature_CaIIK', 'feature_CaIIH', 'feature_ratio_CaK_Hbeta', 'feature_ratio_Halpha_Hbeta']</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">Final number of samples: 2607, Number of features: 6</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">--- STEP 5: Model Training and Evaluation ---</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">&gt; Training the model on 1955 samples...</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">&gt; Model trained.</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">--- Evaluation Report ---</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">            precision    recall  f1-score   support</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         A       0.54      0.54      0.54        41</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         F       0.54      0.55      0.55       140</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         G       0.59      0.59      0.59       215</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         K       0.59      0.58      0.58       168</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         M       0.45      0.46      0.45        87</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         W       0.00      0.00      0.00         1</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">  accuracy                           0.56       652</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> macro avg       0.45      0.45      0.45       652</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">weighted avg     0.55      0.56      0.56       652</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></div></code></pre></div></div><p><img decoding="async" loading="lazy" alt="image info" src="https://phd-brown.github.io/research-docs/assets/images/matrice_04-e6414290626a872f21fdb31f96f84f11.png" width="649" height="547" class="img_ev3q">
<img decoding="async" loading="lazy" alt="image info" src="https://phd-brown.github.io/research-docs/assets/images/missing_features_02-311e5e5a873cb8d20660b27454fd235f.png" width="1189" height="590" class="img_ev3q">
<img decoding="async" loading="lazy" alt="image info" src="https://phd-brown.github.io/research-docs/assets/images/importance_features_01-a0366e82ece8bc594d72b6d7295affe1.png" width="1189" height="590" class="img_ev3q"></p></div></div></details>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="conclusion-and-next-adventures">Conclusion and Next Adventures<a href="https://phd-brown.github.io/research-docs/Blog/2025-07-24-anatomie-pipeline-dia-astrophysique#conclusion-and-next-adventures" class="hash-link" aria-label="Direct link to Conclusion and Next Adventures" title="Direct link to Conclusion and Next Adventures" translate="no">​</a></h3>
<p>This research sprint was a striking demonstration of the power of the iterative method in data science. Starting from a simple model, and improving it step by step based on result analysis, we <strong>improved our baseline by 24 percentage points</strong>.</p>
<p>The AstroSpectro project now has a robust production pipeline and a suite of powerful analysis tools. The next exploration paths are already on the table:</p>
<ul>
<li class=""><strong>Enrich the features</strong> to better classify cool stars (type M) by adding molecular bands.</li>
<li class=""><strong>Experiment with more powerful models</strong> such as XGBoost or neural networks.</li>
<li class=""><strong>Move toward Deep Learning</strong> by using the full spectrum as input to a convolutional neural network (CNN).</li>
</ul>
<p>The laboratory is built. The tools are sharpened. The adventure continues! 🚀</p>]]></content:encoded>
            <category>AstroSpectro</category>
            <category>results</category>
            <category>machine-learning</category>
            <category>feature-engineering</category>
            <category>optimization</category>
        </item>
        <item>
            <title><![CDATA[Notebook Refactoring]]></title>
            <link>https://phd-brown.github.io/research-docs/Blog/refonte-visualisation-astrospectro</link>
            <guid>https://phd-brown.github.io/research-docs/Blog/refonte-visualisation-astrospectro</guid>
            <pubDate>Wed, 23 Jul 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[Toward a Modular Scientific Suite for AstroSpectro: clarity, reusability, and explorability.]]></description>
            <content:encoded><![CDATA[<p>Since the beginning of the <strong>AstroSpectro</strong> project, the notebook <code>[02_tools_and_visuals.ipynb](https://github.com/PhD-Brown/AstroSpectro/blob/main/notebooks/02_tools_and_visuals.ipynb)</code> served as an exploratory notebook. It was where I tested spectrum visualizations, line detections, and diagnostics. But as the tools accumulated, the code became monolithic and difficult to maintain.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="refactoring-goals">Refactoring Goals<a href="https://phd-brown.github.io/research-docs/Blog/refonte-visualisation-astrospectro#refactoring-goals" class="hash-link" aria-label="Direct link to Refactoring Goals" title="Direct link to Refactoring Goals" translate="no">​</a></h2>
<p>I undertook a complete refactor with three objectives in mind:</p>
<ul>
<li class=""><strong>Clarity</strong>: each tool must be readable, self-contained, and clearly named</li>
<li class=""><strong>Reusability</strong>: functions must be modular and usable elsewhere</li>
<li class=""><strong>Explorability</strong>: interactivity must make exploration more intuitive and scientific</li>
</ul>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="final-architecture">Final Architecture<a href="https://phd-brown.github.io/research-docs/Blog/refonte-visualisation-astrospectro#final-architecture" class="hash-link" aria-label="Direct link to Final Architecture" title="Direct link to Final Architecture" translate="no">​</a></h2>
<p>All the logic now lives in <code>src/tools/[visualizer.py](https://github.com/PhD-Brown/AstroSpectro/blob/main/src/tools/visualizer.py)</code>, in the form of a class:</p>
<div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#bfc7d5"><span class="token plain">visualizer </span><span class="token operator" style="color:rgb(137, 221, 255)">=</span><span class="token plain"> AstroVisualizer</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token plain">paths</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></div></code></pre></div></div>
<p>Each interactive tool (header explorer, augmented spectrum, peak tuning, sky map, model inspector) becomes a simple call:</p>
<div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#bfc7d5"><span class="token plain">visualizer</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">interactive_spectrum_analyzer</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">visualizer</span><span class="token punctuation" style="color:rgb(199, 146, 234)">.</span><span class="token plain">plot_sky_coverage</span><span class="token punctuation" style="color:rgb(199, 146, 234)">(</span><span class="token punctuation" style="color:rgb(199, 146, 234)">)</span><br></div></code></pre></div></div>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="new-integrated-tools">New Integrated Tools<a href="https://phd-brown.github.io/research-docs/Blog/refonte-visualisation-astrospectro#new-integrated-tools" class="hash-link" aria-label="Direct link to New Integrated Tools" title="Direct link to New Integrated Tools" translate="no">​</a></h2>
<ul>
<li class="">Dynamic FITS Header Explorer</li>
<li class="">Augmented Spectrum Analyzer (flux + lines + SNR + sliders)</li>
<li class="">Interactive tuning of detection parameters (<code>prominence</code>, <code>window</code>)</li>
<li class="">Analysis of zeros in the extracted features</li>
<li class="">Sky coverage map (Mollweide projection)</li>
<li class=""><code>.pkl</code> model inspector: hyperparameters + feature importance</li>
</ul>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="before--after">Before / After<a href="https://phd-brown.github.io/research-docs/Blog/refonte-visualisation-astrospectro#before--after" class="hash-link" aria-label="Direct link to Before / After" title="Direct link to Before / After" translate="no">​</a></h2>
<p><strong>For example, the code for displaying null features</strong></p>
<p><strong>Before</strong>:</p>
<ul>
<li class="">500 lines of exploratory notebook (example of the null-feature exploration cell below)</li>
<li class="">Spaghetti code that was difficult to reread</li>
</ul>
<p><img decoding="async" loading="lazy" alt="image info" src="https://phd-brown.github.io/research-docs/assets/images/avant-cf7f33e4b875d436b4b3048ddf70b936.png" width="1118" height="838" class="img_ev3q"></p>
<p><strong>After</strong>:</p>
<ul>
<li class="">A dashboard notebook</li>
<li class="">Each tool in its own cell, one call per tool</li>
<li class="">A modular class importable elsewhere</li>
</ul>
<p><img decoding="async" loading="lazy" alt="image info" src="https://phd-brown.github.io/research-docs/assets/images/apres-737968d2731af09404e4d3a017103d0f.png" width="1577" height="165" class="img_ev3q"></p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="impact-on-the-project">Impact on the Project<a href="https://phd-brown.github.io/research-docs/Blog/refonte-visualisation-astrospectro#impact-on-the-project" class="hash-link" aria-label="Direct link to Impact on the Project" title="Direct link to Impact on the Project" translate="no">​</a></h2>
<p>This refactor allows me to:</p>
<ul>
<li class="">Save time when iterating on features and models</li>
<li class="">Work more like in a real lab</li>
<li class="">Prepare the pipeline extension toward spectral cubes (SITELLE, etc.)</li>
</ul>
<blockquote>
<p>And above all… keep having fun. I have already spent more than <strong>200h</strong> on AstroSpectro this summer — and I still do not feel the time passing!</p>
</blockquote>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="next-step">Next Step<a href="https://phd-brown.github.io/research-docs/Blog/refonte-visualisation-astrospectro#next-step" class="hash-link" aria-label="Direct link to Next Step" title="Direct link to Next Step" translate="no">​</a></h2>
<ul>
<li class="">Add spectrum comparators</li>
<li class="">Export analyses (PNG + PDF)</li>
<li class="">Automatically generate a mini exploratory report</li>
<li class="">Everything listed in the <a href="https://phd-brown.github.io/AstroSpectro/docs/community/roadmap" target="_blank" rel="noopener noreferrer" class="">Roadmap</a></li>
</ul>
<blockquote>
<p><em>"Today I realize how enjoyable exploration becomes when the code disappears behind the tool."</em></p>
</blockquote>
<p>Thanks to everyone following the AstroSpectro adventure 🚀</p>]]></content:encoded>
            <category>AstroSpectro</category>
            <category>refactoring</category>
            <category>visualization</category>
            <category>architecture</category>
        </item>
        <item>
            <title><![CDATA[First Model: Lessons from a 32% Baseline]]></title>
            <link>https://phd-brown.github.io/research-docs/Blog/2025-07-22-premier-modele-baseline-32</link>
            <guid>https://phd-brown.github.io/research-docs/Blog/2025-07-22-premier-modele-baseline-32</guid>
            <pubDate>Tue, 22 Jul 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[Secrets from a confusion matrix and the challenges of missing features during the first training run.]]></description>
            <content:encoded><![CDATA[<p>Today marks a crucial milestone for the AstroSpectro project: the first end-to-end training run of our stellar type classification model. After setting up a robust acquisition and processing pipeline for <strong>5000 spectra</strong> from the LAMOST DR5 survey, it was time to see what our first approach could achieve.</p>
<!-- -->
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-first-iteration-a-simple-but-honest-model">The First Iteration: A Simple but Honest Model<a href="https://phd-brown.github.io/research-docs/Blog/2025-07-22-premier-modele-baseline-32#the-first-iteration-a-simple-but-honest-model" class="hash-link" aria-label="Direct link to The First Iteration: A Simple but Honest Model" title="Direct link to The First Iteration: A Simple but Honest Model" translate="no">​</a></h3>
<p>To establish a <strong>baseline</strong>, the goal was to build the simplest possible model in order to validate the integrity of the processing chain. The strategy was as follows:</p>
<ul>
<li class=""><strong><a href="https://phd-brown.github.io/AstroSpectro/docs/user-guides/model-training" target="_blank" rel="noopener noreferrer" class="">Model</a> :</strong> A <code>RandomForestClassifier</code>, a robust and well-understood algorithm.</li>
<li class=""><strong><a href="https://phd-brown.github.io/AstroSpectro/docs/user-guides/feature-extraction" target="_blank" rel="noopener noreferrer" class="">Features</a> :</strong> Only four characteristics, based on the <strong>position</strong> of the best-known absorption lines <code>Hα, Hβ, CaII H &amp; K</code>. The goal was to verify whether this minimal information already contained a predictive signal.</li>
</ul>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-result-32-accuracy">The Result: 32% Accuracy<a href="https://phd-brown.github.io/research-docs/Blog/2025-07-22-premier-modele-baseline-32#the-result-32-accuracy" class="hash-link" aria-label="Direct link to The Result: 32% Accuracy" title="Direct link to The Result: 32% Accuracy" translate="no">​</a></h3>
<p>After training and evaluation on a test set of 1250 spectra, the model reached an overall accuracy of <strong>32%</strong>.</p>
<p>Although this score may seem modest, it is an extremely promising starting point. In a classification problem with so many classes <code>A, B, C, F, G, K, M, N, s</code>, random prediction would only achieve about 9% correct answers. Our 32% score is therefore <strong>more than three times better than chance</strong>, which proves that our pipeline works and that the features, even simple ones, contain an exploitable signal.</p>
<details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>View the results in detail</summary><div><div class="collapsibleContent_i85q"><div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#bfc7d5"><span class="token plain">Features used for training: ['feature_Hα', 'feature_Hβ', 'feature_CaIIK', 'feature_CaIIH']</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">Number of samples: 5000, Number of features: 4</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">Training the model on 3750 samples...</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">--- Evaluation Report ---</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">            precision    recall  f1-score   support</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         A       0.40      0.59      0.48        79</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         B       0.00      0.00      0.00         1</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         C       0.00      0.00      0.00         1</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         D       0.00      0.00      0.00         1</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         F       0.41      0.51      0.46       239</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         G       0.51      0.26      0.34       393</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         K       0.37      0.24      0.29       294</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         M       0.14      0.13      0.14       152</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         N       0.30      0.37      0.33        89</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         W       0.00      0.00      0.00         0</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">         s       0.00      0.00      0.00         1</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">  accuracy                           0.32      1250</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain"> macro avg       0.19      0.19      0.18      1250</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain">weighted avg     0.39      0.32      0.33      1250</span><br></div><div class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></div></code></pre></div></div></div></div></details>
<blockquote>
<p>But the most interesting part is not the score itself, but what the model's <strong>errors</strong> teach us.</p>
</blockquote>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-analysis-the-confusion-matrix-speaks">The Analysis: The Confusion Matrix Speaks<a href="https://phd-brown.github.io/research-docs/Blog/2025-07-22-premier-modele-baseline-32#the-analysis-the-confusion-matrix-speaks" class="hash-link" aria-label="Direct link to The Analysis: The Confusion Matrix Speaks" title="Direct link to The Analysis: The Confusion Matrix Speaks" translate="no">​</a></h3>
<p>The confusion matrix is a true map of our model's "thinking". Two observations stand out immediately:</p>
<p><img decoding="async" loading="lazy" alt="image info" src="https://phd-brown.github.io/research-docs/assets/images/matrice_01-fd85f7cb467cf11d3a7a05cc0bd4eb43.png" width="649" height="547" class="img_ev3q"></p>
<ol>
<li class=""><strong>Data Imbalance:</strong> The model is unable to classify stars of type <code>B, C, D or s</code>, because it saw only a single example of each in the test set. This is a classic lesson in AI: a model cannot learn what it does not see.</li>
<li class=""><strong>"Physical Confusion":</strong> Where the model makes mistakes, it does so in a <strong>logical</strong> way. For example, it massively confuses <code>G</code>-type stars with <code>F</code> and <code>K</code> types. This is normal: these types are adjacent in the spectral sequence and look very similar. The model has therefore learned the stellar "geography" well, but struggles to draw precise boundaries.</li>
</ol>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-root-cause-the-missing-features-problem">The Root Cause: The Missing Features Problem<a href="https://phd-brown.github.io/research-docs/Blog/2025-07-22-premier-modele-baseline-32#the-root-cause-the-missing-features-problem" class="hash-link" aria-label="Direct link to The Root Cause: The Missing Features Problem" title="Direct link to The Root Cause: The Missing Features Problem" translate="no">​</a></h3>
<p>Analysis of our extracted features revealed the heart of the problem. A graph showing the percentage of null values for each feature is quite clear:</p>
<p><img decoding="async" loading="lazy" alt="image info" src="https://phd-brown.github.io/research-docs/assets/images/missing_features_01-03af1027d5fba1cf25d530cbbc63fd24.png" width="1189" height="590" class="img_ev3q"></p>
<p>This graph, which analyzes <strong>our entire dataset of 5000 spectra</strong>, reveals a surprising reality: the feature based on the <strong>Hα line is absent in more than 80% of cases</strong>. The Hβ and CaII H/K lines are detected more frequently, but they still remain missing in a non-negligible fraction of the observations.</p>
<p>The model therefore had to make its decisions based on very incomplete information. Reaching 32% under these conditions proves that the calcium lines and <code>Hβ</code> are powerful indicators, but also that the model is strongly limited by the difficulty of extracting a clear <code>Hα</code> signal with the current parameters.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="next-steps-the-hunt-for-real-features-is-on">Next Steps: The Hunt for Real Features Is On!<a href="https://phd-brown.github.io/research-docs/Blog/2025-07-22-premier-modele-baseline-32#next-steps-the-hunt-for-real-features-is-on" class="hash-link" aria-label="Direct link to Next Steps: The Hunt for Real Features Is On!" title="Direct link to Next Steps: The Hunt for Real Features Is On!" translate="no">​</a></h3>
<p>This first result is not an endpoint, but a documented starting point. The <a href="https://phd-brown.github.io/AstroSpectro/docs/community/roadmap" target="_blank" rel="noopener noreferrer" class="">roadmap</a> for the next iteration is clear: we need to provide our model with better-quality "ingredients".</p>
<ol>
<li class=""><strong>Measure Strength, Not Presence:</strong> The next version of the pipeline will no longer only determine whether a line is present, but will measure its <strong>depth</strong> (through peak <code>prominence</code>). This is much richer physical information.</li>
<li class=""><strong>Create Ratio Features:</strong> We will compute ratios between the depths of different lines. These ratios are well-known temperature indicators in astrophysics and should help the model better distinguish adjacent classes (such as <code>F, G and K</code>).</li>
<li class=""><strong>Clean the Dataset:</strong> For the next evaluation, we will focus on the classes for which we have a sufficient number of examples <code>A, F, G, K, M</code> in order to obtain more reliable and interpretable performance metrics.</li>
</ol>
<blockquote>
<p>This 32% baseline is the foundation on which we will build. Every future improvement can be measured against this starting point, demonstrating the direct impact of our feature engineering work.</p>
</blockquote>
<p>Stay tuned!</p>]]></content:encoded>
            <category>AstroSpectro</category>
            <category>machine-learning</category>
            <category>baseline</category>
            <category>feature-engineering</category>
        </item>
        <item>
            <title><![CDATA[Journal Entry: Documentation v0.1.0-alpha Is Complete!]]></title>
            <link>https://phd-brown.github.io/research-docs/Blog/doc-v0.1.0-alpha-complete</link>
            <guid>https://phd-brown.github.io/research-docs/Blog/doc-v0.1.0-alpha-complete</guid>
            <pubDate>Tue, 15 Jul 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[The transition from a simple README to a full Docusaurus site with automated CI/CD deployment.]]></description>
            <content:encoded><![CDATA[<p>Today marks a major milestone for the AstroSpectro project: the structure and core content of the documentation for version <code>v0.1.0-alpha</code> are officially complete!</p>
<!-- -->
<p>It has been an incredible journey, going from a simple <code>README.md</code> to a full Docusaurus site, with a custom design, automated CI/CD deployment, and structured guides.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-has-been-accomplished">What has been accomplished:<a href="https://phd-brown.github.io/research-docs/Blog/doc-v0.1.0-alpha-complete#what-has-been-accomplished" class="hash-link" aria-label="Direct link to What has been accomplished:" title="Direct link to What has been accomplished:" translate="no">​</a></h3>
<ul>
<li class=""><strong>An immersive homepage</strong> with a strong visual identity.</li>
<li class=""><strong>Documentation structured</strong> by intent: Quick Start, Scientific Context, Practical Guides, etc.</li>
<li class=""><strong>Polished pages with React/MDX</strong> for an interactive user experience.</li>
<li class=""><strong>A fully automated deployment workflow</strong> via GitHub Actions.</li>
</ul>
<p>This solid foundation will allow us to focus confidently on the next phase: continuously improving the pipeline and implementing the features from the <strong><a class="" href="https://phd-brown.github.io/research-docs/docs/astrospectro/community/roadmap">Roadmap</a></strong>.</p>
<p>Thank you to everyone following the project. The journey is only just beginning!</p>]]></content:encoded>
            <category>AstroSpectro</category>
            <category>documentation</category>
            <category>milestone</category>
            <category>v0.1.0-alpha</category>
        </item>
    </channel>
</rss>