<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://charlie-xiao.github.io/feed.xml" rel="self" type="application/atom+xml"/><link href="https://charlie-xiao.github.io/" rel="alternate" type="text/html" hreflang="en"/><updated>2025-08-03T03:09:56+00:00</updated><id>https://charlie-xiao.github.io/feed.xml</id><title type="html">Yao Xiao</title><subtitle>Yao Xiao&apos;s portfolio website. </subtitle><entry><title type="html">a post with plotly.js</title><link href="https://charlie-xiao.github.io/blog/2025/plotly/" rel="alternate" type="text/html" title="a post with plotly.js"/><published>2025-03-26T14:24:00+00:00</published><updated>2025-03-26T14:24:00+00:00</updated><id>https://charlie-xiao.github.io/blog/2025/plotly</id><content type="html" xml:base="https://charlie-xiao.github.io/blog/2025/plotly/"><![CDATA[<p>This is an example post with some <a href="https://plotly.com/javascript/">plotly</a> code.</p> <div class="language-markdown highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">```</span><span class="nl">plotly
</span><span class="sb">{
  "data": [
    {
      "x": [1, 2, 3, 4],
      "y": [10, 15, 13, 17],
      "type": "scatter"
    },
    {
      "x": [1, 2, 3, 4],
      "y": [16, 5, 11, 9],
      "type": "scatter"
    }
  ]
}</span>
<span class="p">```</span>
</code></pre></div></div> <p>Which generates:</p> <pre><code class="language-plotly">{
  "data": [
    {
      "x": [1, 2, 3, 4],
      "y": [10, 15, 13, 17],
      "type": "scatter"
    },
    {
      "x": [1, 2, 3, 4],
      "y": [16, 5, 11, 9],
      "type": "scatter"
    }
  ]
}
</code></pre> <p>Also another example chart.</p> <div class="language-markdown highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">```</span><span class="nl">plotly
</span><span class="sb">{
  "data": [
    {
      "x": [1, 2, 3, 4],
      "y": [10, 15, 13, 17],
      "mode": "markers"
    },
    {
      "x": [2, 3, 4, 5],
      "y": [16, 5, 11, 9],
      "mode": "lines"
    },
    {
      "x": [1, 2, 3, 4],
      "y": [12, 9, 15, 12],
      "mode": "lines+markers"
    }
  ],
  "layout": {
    "title": {
      "text": "Line and Scatter Plot"
    }
  }
}</span>
<span class="p">```</span>
</code></pre></div></div> <p>This is how it looks like:</p> <pre><code class="language-plotly">{
  "data": [
    {
      "x": [1, 2, 3, 4],
      "y": [10, 15, 13, 17],
      "mode": "markers"
    },
    {
      "x": [2, 3, 4, 5],
      "y": [16, 5, 11, 9],
      "mode": "lines"
    },
    {
      "x": [1, 2, 3, 4],
      "y": [12, 9, 15, 12],
      "mode": "lines+markers"
    }
  ],
  "layout": {
    "title": {
      "text": "Line and Scatter Plot"
    }
  }
}
</code></pre>]]></content><author><name></name></author><category term="sample-posts"/><category term="formatting"/><category term="charts"/><summary type="html"><![CDATA[this is what included plotly.js code could look like]]></summary></entry><entry><title type="html">Fixing KernelDensity’s handling of data variance in scikit-learn</title><link href="https://charlie-xiao.github.io/blog/2024/scikit-learn-kde/" rel="alternate" type="text/html" title="Fixing KernelDensity’s handling of data variance in scikit-learn"/><published>2024-09-11T00:00:00+00:00</published><updated>2024-09-11T00:00:00+00:00</updated><id>https://charlie-xiao.github.io/blog/2024/scikit-learn-kde</id><content type="html" xml:base="https://charlie-xiao.github.io/blog/2024/scikit-learn-kde/"><![CDATA[<p>Scikit-learn has a tree-based implementation of kernel density estimation in <a href="https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.KernelDensity.html"><code class="language-plaintext highlighter-rouge">KernelDensity</code></a>. You may checkout <a href="https://jakevdp.github.io/blog/2013/12/01/kernel-density-estimation/">this post</a> by the original author. The tree-based implementation outperforms the naive implementation <a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.gaussian_kde.html"><code class="language-plaintext highlighter-rouge">gaussian_kde</code></a> in scipy, thus being suitable for large datasets.</p> <p>Yet as revealed in <a href="https://github.com/scikit-learn/scikit-learn/issues/25623">#25623</a> and <a href="https://github.com/scikit-learn/scikit-learn/issues/25623">#26658</a>, <code class="language-plaintext highlighter-rouge">KernelDensity</code> consistently gave incorrect results on data with non-unit variance. In this blog post we will go through the underlying issues and the corresponding fix.</p> <h2 id="problem-reproduction">Problem Reproduction</h2> <p>Let us begin with a simple example to reveal the problem. Here we draw samples from the normal distribution, but with different scales (i.e., standard deviations) 1, 0.1, and 10, and perform kernel density estimation respectively.</p> <div class="jupyter-notebook" style="position: relative; width: 100%; margin: 0 auto;"> <div class="jupyter-notebook-iframe-container"> <iframe src="/assets/jupyter/posts/scikit-learn-kde/incorrect-results.ipynb.html" style="position: absolute; top: 0; left: 0; border-style: none;" width="100%" height="100%" onload="this.parentElement.style.paddingBottom = (this.contentWindow.document.documentElement.scrollHeight + 10) + 'px'"></iframe> </div> </div> <p>As we can see from the plots, scikit-learn’s results were far from the underlying distribution for <code class="language-plaintext highlighter-rouge">scale=0.1</code> and <code class="language-plaintext highlighter-rouge">scale=10</code> while scipy gave reasonable estimations.</p> <h2 id="problem-analysis">Problem Analysis</h2> <p>We will start with the univariate case. By definition, let \((x_1,\ldots,x_n)\) be independent and identially distributed samples drawn from some univariate distribution, its kernel density estimator at a given point \(x\) is</p> \[\hat{f}_h(x)=\frac{1}{n}\sum_{i=1}^nK_h(x-x_i)=\frac{1}{nh}\sum_{i=1}^nK\left(\frac{x-x_i}{h}\right),\] <p>where \(K\) is the kernel function and \(h\) is the <strong>bandwidth</strong>. <em>This is exactly how scikit-learn implemented kernel density estimation,</em> but a good bandwidth should be chosen proportional to the standard deviation of data. If we use Scott’s or Silverman’s rule of thumb (as in the example above) for automatic bandwidth selection, it does not take into account data variance. Thus for <code class="language-plaintext highlighter-rouge">scale=0.1</code>, the chosen bandwidth would be too large and over-smoothens the estimation, and for <code class="language-plaintext highlighter-rouge">scale=10</code>, the chosen bandwidth would be too small causing the estimation to be too sensitive to noise.</p> <p>Moreover in scipy’s context, the <code class="language-plaintext highlighter-rouge">bw_method</code> parameter (equivalent to scikit-learn’s <code class="language-plaintext highlighter-rouge">bandwidth</code> parameter) does not directly give the \(h\) as in the formula. It is scaled to adapt to the variance of data, or equivalently, the data is scaled to unit variance before applying the formula above, which aligns with the analysis above.</p> <p>What about multivariate data? The formula is similar, such that</p> \[\hat{f}_H(\mathbf{x})=\frac{1}{n}\sum_{i=1}^nK_H(\mathbf{x}-\mathbf{x}_i)=\frac{1}{n|H|}\sum_{i=1}^nK\left(H^{-1}(\mathbf{x}-\mathbf{x}_i)\right),\] <p>except that this time we have a bandwidth matrix. Also similar to the univariate case, a good bandwidth matrix should be chosen proportional to \(\Sigma^{1/2}\) where \(\Sigma\) is the covariance matrix of data. In other words, the bandwidth in each dimension should have unit variance. Otherwise, the same thing as in the univariate case will happen per dimension.</p> <h2 id="proposed-solution">Proposed Solution</h2> <p>The issue is not hard to solve, but to first summarize our analysis, we want the <code class="language-plaintext highlighter-rouge">bandwidth</code> parameter to be properly scaled before estimation because:</p> <ul> <li>We want to respect the rules of thumb, e.g., Scott’s rule and Silverman’s rule.</li> <li>We want to be consistent with other scientific Python libraries like <code class="language-plaintext highlighter-rouge">scipy</code> and <code class="language-plaintext highlighter-rouge">statsmodels</code> to avoid confusion of users.</li> <li>We want to make the API easy-to-use. In particular, there is no clear reason to let users manually handle data variance when choosing bandwidth, especially in the multivariate case where users would even need to choose a bandwidth vector if the scaling is not performed internally.</li> </ul> <p>Let \(h\) now be the <code class="language-plaintext highlighter-rouge">bandwidth</code> parameter (i.e., before scaling), then we can rewrite the formula into</p> \[\hat{f}_h(\mathbf{x})=\frac{1}{nh|\Sigma^{-1/2}|}\sum_{i=1}^nK\left(\frac{\Sigma^{-1}(\mathbf{x}-\mathbf{x}_i)}{h}\right).\] <p>Compared with the previous (incorrect) implementation</p> \[\hat{f}_h(\mathbf{x})=\frac{1}{nh}\sum_{i=1}^nK\left(\frac{\mathbf{x}-\mathbf{x}_i}{h}\right),\] <p>it suffices to (1) input \(\Sigma^{-1/2}\mathbf{x}\) instead of \(\mathbf{x}\), and (2) divide by \(\Sigma^{-1/2}\) for the output. Note that \(\Sigma^{1/2}\) can be computed from the covariance matrix (<code class="language-plaintext highlighter-rouge">np.cov</code>) with Cholesky decomposition (<code class="language-plaintext highlighter-rouge">scipy.linalg.cholesky</code>), so \(\mathbf{v}=\Sigma^{-1/2}\mathbf{x}\) can be obtained by simply solving \(\Sigma^{1/2}\cdot\mathbf{v}=\mathbf{x}\) (<code class="language-plaintext highlighter-rouge">scipy.linalg.solve_triangular</code>).</p> <p>You may want to check out the actual fix in <a href="https://github.com/scikit-learn/scikit-learn/pull/27971">#27971</a> as well.</p> <h2 id="future-work">Future Work</h2> <ul> <li> <p>There is another potential issue <a href="https://github.com/scikit-learn/scikit-learn/issues/27186">#27186</a> in the scikit-learn tree-based implementation, which is not yet confirmed as it has not revealed any unexpected behavior in practice.</p> </li> <li> <p>The <code class="language-plaintext highlighter-rouge">sample_weight</code> support (originally implemented in <a href="https://github.com/scikit-learn/scikit-learn/pull/10803">#10803</a>) in kernel density estimation is unexpectedly slow. The tree-based implementation of scikit-learn was meant to be faster than the naive implementation of <code class="language-plaintext highlighter-rouge">scipy</code>, but with <code class="language-plaintext highlighter-rouge">sample_weight</code> it is several or tens of times slower, even if we allow some tolerance.</p> </li> </ul>]]></content><author><name></name></author><category term="open-source"/><category term="scikit-learn"/><summary type="html"><![CDATA[A deep dive into addressing the abnormal behavior of KernelDensity on non-unit variance data.]]></summary></entry><entry><title type="html">Interview with Yao Xiao, scikit-learn Team Member - scikit-learn Blog</title><link href="https://charlie-xiao.github.io/blog/2024/interview-with-yao-xiao-scikit-learn-team-member-scikit-learn-blog/" rel="alternate" type="text/html" title="Interview with Yao Xiao, scikit-learn Team Member - scikit-learn Blog"/><published>2024-07-18T00:00:00+00:00</published><updated>2024-07-18T00:00:00+00:00</updated><id>https://charlie-xiao.github.io/blog/2024/interview-with-yao-xiao-scikit-learn-team-member---scikit-learn-blog</id><content type="html" xml:base="https://charlie-xiao.github.io/blog/2024/interview-with-yao-xiao-scikit-learn-team-member-scikit-learn-blog/"><![CDATA[<p>Open source library for machine learning in Python.</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>    2024-07-18
  





  
  

  
    
    
      3 minute read
</code></pre></div></div> <p>Yao Xiao recently earned his undergraduate degree in mathematics and computer science. He will be pursuing a Master’s degree in Computational Science and Engineering at Harvard SEAS. Yao joined the scikit-learn team in February 2024.Tell us about yourself.My name is Yao Xiao and I live in Shanghai, China. At the time of interview I have just got my Bachelor’s degree in Honors Mathematics and Computer Science at NYU Shanghai, and I’m going to pursue a Master’s degree in Computational Science and Engineering at Harvard SEAS. My current research interests are in networks and systems (e.g. sys4ml and ml4sys), but this may change in the future.How did you first become involved in open source and scikit-learn?In my junior year I took a course at NYU Courant called Open Source Software Development where we needed to make contributions to an open source software as our final project - and I chose scikit-learn.We would love to learn of your open source journey.I was lucky to get involved in a pretty easy meta-issue when I first started contributing to scikit-learn. I made quite a few PRs towards that issue, familiarizing myself with the coding standards, contributing workflow etc., and during which I gradually explored the codebase and learned a lot from maintainers how to write better code. After that meta-issue was completed, I decided to continue contributing since I enjoyed the experience, and I started looking through the open issues, tried reproducing and investigating them, then opened PRs for those that I was able to solve. It is the process of familiarizing with more parts of the codebase, being able to make more PRs, so on and so forth. While contributing to scikit-learn, sometimes there are also issues to solve upstream, so I also had opportunities to contribute to projects like pandas and pydata-sphinx-theme. Up till today I’m still far from familiar with the entire scikit-learn project, but I will definitely continue the amazing open-source journey.To which OSS projects and communities do you contribute?I have contributed to scikit-learn, pandas, pydata-sphinx-theme, sphinx-gallery. I’m also writing some small softwares that I decide to make open source.What do you find alluring about OSS?It is amazing to feel that my code is being used by so many people all around the world through contributing to open source projects. Well it might be inappropriate to say “my code”, but I do feel like making some actual contributions to the community instead of just writing code for myself. Also OSS makes me care about code quality and so on instead of merely making things “work”, which is very important for programmers but not really taught in school.What pain points do you observe in community-led OSS?Collaboration can lead to better code but also slows down the development process. Especially when there are not enough reviewers around, issues and PRs can easily get stale or forgotten. But I would say it’s more like a tradeoff rather than a pain point.If we discuss how far OS has evolved in 10 years, what would you like to see happen?I couldn’t say about the past 10 years since I’ve only been involved for about one and a half years, but regarding the scientific Python ecosystem I would like to see better coordination across projects (which is already happening). For instance a common interface for array libraries and dataframe libraries would allow downstream dependents to easily provide more flexible support for different input/output types, etc. And as a Chinese I would also hope that open source can thrive in my country some day as well.What are your favorite resources, books, courses, conferences, etc?As for physical books I would recommend The Pragmatic Programmer by Andy Hunt and Dave Thomas, and Refactoring: Improving the Design of Existing Code by Martin Fowler and Kent Back. As for courses I like MIT’s The Missing Semester of Your CS Education. In particular about learning Python, The Python Tutorial in the official Python documentation is good enough for me. By the way I want to mention that documentations of most languages and popular packages are very nice and they are the best place to learn the most up-to-date information.What are your hobbies, outside of work and open source?I would say my largest hobby is programming (not for school, not for work, just for fun). I’ve recently been fascinated with Tauri and wrote a lot of small desktop applications for myself in my spare time. Apart from this I also love playing the piano and I’m an anime lover, so I often listen to or play piano versions of anime theme songs (mostly arranged by Animenz). Tags:</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>  Open Source


  
 Categories: 


  Team
</code></pre></div></div> <p>Updated: 2024-07-18</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>    2024-12-12
  





  
  

  
    
    
      3 minute read
</code></pre></div></div> <p>Author:<br/> Adrin Jalali</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>    2024-09-02
  





  
  

  
    
    
      1 minute read
</code></pre></div></div> <p>Author:<br/> Inessa Pawson</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>  , 


  
  
  
  

  

  


  François Goupil
  
    
  







  
  
    
    
    2024-08-06
  





  
  

  
    
    
      3 minute read
</code></pre></div></div> <p>Author:<br/> Guillaume Lemaitre ,</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>  Lucy Liu
 







  
  
    
    
    2024-07-24
  





  
  

  
    
    
      8 minute read
</code></pre></div></div> <p>Author:<br/> Reshama Shaikh ,</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>  Adam Li
</code></pre></div></div>]]></content><author><name></name></author><summary type="html"><![CDATA[Author: Reshama Shaikh , Yao Xiao]]></summary></entry><entry><title type="html">Scikit-learn Website Rework</title><link href="https://charlie-xiao.github.io/blog/2024/scikit-learn-website-rework/" rel="alternate" type="text/html" title="Scikit-learn Website Rework"/><published>2024-06-04T00:00:00+00:00</published><updated>2024-06-04T00:00:00+00:00</updated><id>https://charlie-xiao.github.io/blog/2024/scikit-learn-website-rework</id><content type="html" xml:base="https://charlie-xiao.github.io/blog/2024/scikit-learn-website-rework/"><![CDATA[<p>The <a href="https://scikit-learn.org/1.5/">scikit-learn main website</a> has got a brand-new appearance since version 1.5, with migration to the <a href="https://pydata-sphinx-theme.readthedocs.io/en/stable/">PyData Sphinx theme</a> along with other UI/UX improvements. Thanks for the theme developers and whoever involved in the conversations. You may want to check out <a href="https://github.com/scikit-learn/scikit-learn/issues/28084">#28084</a> that tracked the migration progress and <a href="https://github.com/scikit-learn/scikit-learn/pull/29038">#29038</a> that did the final merge.</p> <h2 id="dark-theme">Dark Theme</h2> <p>PyData theme has built-in support for <a href="https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/light-dark.html">light and dark themes</a> as well as the theme switcher. In particular we adapted dark theme support for our customized landing page as well, while retaining the old appearance as much as possible. See <a href="https://github.com/scikit-learn/scikit-learn/pull/28331">#28331</a> for technical details.</p> <div class="row mt-3"> <div class="col-sm mt-3 mt-md-0"> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/scikit-learn-website-rework/index-light-mode-480.webp 480w,/assets/img/posts/scikit-learn-website-rework/index-light-mode-800.webp 800w,/assets/img/posts/scikit-learn-website-rework/index-light-mode-1400.webp 1400w," type="image/webp" sizes="95vw"/> <img src="/assets/img/posts/scikit-learn-website-rework/index-light-mode.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="lazy" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> <figcaption class="caption">Light Theme.</figcaption> </figure> </div> <div class="col-sm mt-3 mt-md-0"> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/scikit-learn-website-rework/index-dark-mode-480.webp 480w,/assets/img/posts/scikit-learn-website-rework/index-dark-mode-800.webp 800w,/assets/img/posts/scikit-learn-website-rework/index-dark-mode-1400.webp 1400w," type="image/webp" sizes="95vw"/> <img src="/assets/img/posts/scikit-learn-website-rework/index-dark-mode.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="lazy" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> <figcaption class="caption">Dark Theme.</figcaption> </figure> </div> </div> <h2 id="reworked-api-pages">Reworked API Pages</h2> <p>The <a href="https://scikit-learn.org/1.5/api/index.html">API pages</a> are reworked. In particular, the index page now contains a search-as-you-type table of all APIs powered by <a href="https://datatables.net/">DataTables</a>, and the primary sidebar now lists APIs in hierarchy. Moreover within each API page, the secondary sidebar now has links to all methods and gallery examples (if any). All these UI/UX changes are meant to provide better navigation experience. See <a href="https://github.com/scikit-learn/scikit-learn/pull/28428">#28428</a> for technical details.</p> <div class="row mt-3"> <div class="col-sm mt-3 mt-md-0"> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/scikit-learn-website-rework/api-index-480.webp 480w,/assets/img/posts/scikit-learn-website-rework/api-index-800.webp 800w,/assets/img/posts/scikit-learn-website-rework/api-index-1400.webp 1400w," type="image/webp" sizes="95vw"/> <img src="/assets/img/posts/scikit-learn-website-rework/api-index.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="lazy" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> <figcaption class="caption">API index page with the searchable table.</figcaption> </figure> </div> <div class="col-sm mt-3 mt-md-0"> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/scikit-learn-website-rework/api-page-480.webp 480w,/assets/img/posts/scikit-learn-website-rework/api-page-800.webp 800w,/assets/img/posts/scikit-learn-website-rework/api-page-1400.webp 1400w," type="image/webp" sizes="95vw"/> <img src="/assets/img/posts/scikit-learn-website-rework/api-page.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="lazy" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> <figcaption class="caption">Enhanced sidebar navigation per API page.</figcaption> </figure> </div> </div> <h2 id="reworked-dropdowns">Reworked Dropdowns</h2> <p>The dropdowns (i.e., folded sections) were redesigned based on the dropdown feature of <a href="https://sphinx-design.readthedocs.io/en/pydata-theme/">Sphinx Design</a>. Except for all its built-in features, we implemented permalink anchor for each dropdowns and the <em>toggle all dropdowns</em> functionality. The latter is because certain browsers (e.g., Firefox) does not search into collapsed dropdowns, so we provide the ability to unfold all with one click. See <a href="https://github.com/scikit-learn/scikit-learn/pull/28401">#28401</a> for technical details.</p> <h2 id="reworked-installation-guide">Reworked Installation Guide</h2> <p>The <a href="https://scikit-learn.org/1.5/install.html">installation guide</a> is reworked. In particular, the previous implementation for switching between instructions for different operating systems and package managers was minimal and unpolished. With the tabs feature of <a href="https://sphinx-design.readthedocs.io/en/pydata-theme/">Sphinx Design</a> along with some customizations, we worked out the new more native-looking and powerful installation guide. See <a href="https://github.com/scikit-learn/scikit-learn/pull/28336">#28336</a> for technical details.</p> <div class="row mt-3"> <div class="col-sm mt-3 mt-md-0"> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/scikit-learn-website-rework/install-480.webp 480w,/assets/img/posts/scikit-learn-website-rework/install-800.webp 800w,/assets/img/posts/scikit-learn-website-rework/install-1400.webp 1400w," type="image/webp" sizes="95vw"/> <img src="/assets/img/posts/scikit-learn-website-rework/install.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="lazy" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> <figcaption class="caption">The reworked installation guide.</figcaption> </figure> </div> </div> <h2 id="enhanced-gallery-ui">Enhanced Gallery UI</h2> <p>Previously the badge links to JupyterLite and Binder launchers as well as the download links of Python source code and Jupyter notebooks lived at the bottom of each page, with a hint at the top of the page linking to the bottom. With the three-column layout of the PyData theme, these information are all moved to the secondary sidebar (on the right side) for better UI/UX. See <a href="https://github.com/scikit-learn/scikit-learn/pull/28512">#28512</a> for technical details of our temporary workaround and <a href="https://github.com/sphinx-gallery/sphinx-gallery/pull/1312">sphinx-gallery/sphinx-gallery#1312</a> for my better solution upstream.</p> <div class="row mt-3"> <div class="col-sm mt-3 mt-md-0"> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/scikit-learn-website-rework/gallery-page-480.webp 480w,/assets/img/posts/scikit-learn-website-rework/gallery-page-800.webp 800w,/assets/img/posts/scikit-learn-website-rework/gallery-page-1400.webp 1400w," type="image/webp" sizes="95vw"/> <img src="/assets/img/posts/scikit-learn-website-rework/gallery-page.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="lazy" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> <figcaption class="caption">A gallery page with badges and download links in the sidebar.</figcaption> </figure> </div> </div> <h2 id="conclusion">Conclusion</h2> <p>There are many more small improvements in the website and technical details that I want to share, but due to the limited space, I encourage you to visit the <a href="https://scikit-learn.org/">scikit-learn website</a> and explore the new theme yourself. We are still continuously making improvements to our docs, and new versions of dependencies sometimes break out customizations. Feel free to report in the <a href="https://github.com/scikit-learn/scikit-learn/issues">scikit-learn issue tracker</a> if you have nice ideas for improvements or if you have found anything broken. Many thanks again to the theme developers and people involved!</p>]]></content><author><name></name></author><category term="open-source"/><category term="scikit-learn"/><summary type="html"><![CDATA[A brief walk-through of some significant changes in the new theme.]]></summary></entry></feed>