<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>Blog</title>
<link>https://mlr3hf-blog.netlify.app/</link>
<atom:link href="https://mlr3hf-blog.netlify.app/index.xml" rel="self" type="application/rss+xml"/>
<description>A blog built with Quarto</description>
<generator>quarto-1.10.18</generator>
<lastBuildDate>Thu, 20 Aug 2026 00:00:00 GMT</lastBuildDate>
<item>
  <title>Google Summer of Code 2026 – Final Report</title>
  <dc:creator>Anjani Nandan</dc:creator>
  <link>https://mlr3hf-blog.netlify.app/posts/gsoc-report/</link>
  <description><![CDATA[ 





<section id="overview" class="level2">
<h2 class="anchored" data-anchor-id="overview">Overview</h2>
<p>I am Anjani Nandan, and my Google Summer of Code (GSoC) journey has a lot of meaning for me.</p>
<p>Before GSoC, I had almost no knowledge about what GSoC was or how open-source development actually worked. When I started this journey, my main expectation was to learn technical skills and contribute to a real software project. However, by the end of the program, I realized that GSoC gave me much more than technical knowledge.</p>
<p>This report is not only about what I implemented technically. It is also about how GSoC positively impacted me as a person and as a future software engineer.</p>
<p>One of the biggest things I learned was <strong>how to work professionally</strong>: how to communicate with mentors, how to discuss technical decisions, how to take responsibility for my work, and how to think about a problem before jumping into implementation.</p>
<p>My mentors played an immense role in transforming many of my naive ideas into much more mature approaches. What I appreciated most was the freedom they gave me to think independently.</p>
<p>Instead of always telling me what to implement, they often gave me a problem, explained the context, and allowed me to explore possible solutions on my own. I would then come back with my understanding, ideas, and questions, and we would discuss them together.</p>
<p>This taught me an important lesson: <strong>independent thinking does not mean working alone</strong>. Good teamwork can actually create space for independent thinking while still providing collaboration, discussion, and feedback when needed.</p>
<p>During the project, I also encountered and learned several concepts and tools that were new to me. Some of the important ones were:</p>
<ul>
<li><p><strong>Symbolic links (symlinks):</strong> A symbolic link is a special type of file that points to another file or directory. I used this concept while working on the caching system, where symlinks can help avoid unnecessary duplication of dataset files while still making them accessible from different locations.</p></li>
<li><p><strong>Pagination:</strong> APIs may return a large number of results, so instead of returning everything in a single response, the results are divided into smaller pages. I learned how to work with paginated Hugging Face APIs to retrieve datasets in manageable chunks.</p></li>
<li><p><strong><code>vcr</code>:</strong> <code>vcr</code> is an R package used for recording HTTP requests and their responses so that they can be replayed during testing. This allows tests involving external APIs to be more reliable and avoids making unnecessary network requests every time the tests are run.</p></li>
<li><p><strong>Caching for dataset revisions:</strong> A dataset can have multiple versions or revisions over time. I learned how to design a caching system that can distinguish between different revisions, including specific commit hashes, so that users can reliably access the version of the dataset they requested.</p></li>
<li><p><strong><code>pkgdown</code>:</strong> <code>pkgdown</code> is an R tool for automatically generating websites and documentation for R packages. I learned how package documentation, reference pages, articles, and other resources can be organized and published as a documentation website.</p></li>
<li><p><strong>Parallel API fetching:</strong> When working with APIs, making requests one after another can be slow, especially when many independent requests are required. I learned how to perform multiple API requests concurrently to improve the efficiency of operations such as fetching dataset information.</p></li>
<li><p><strong>Other packages in the <code>mlr3</code> ecosystem:</strong> I also explored related packages such as <code>mlr3</code> and <code>mlr3learners</code> to understand how the different components of the ecosystem work together. This helped me understand how datasets are represented as Tasks and how those Tasks can subsequently be used with machine learning learners and other <code>mlr3</code> functionality.</p></li>
</ul>
<p>Working on a real project helped me understand not only <strong>what these concepts mean, but also why and when they are useful in real software systems</strong>.</p>
<p>I worked on the repository <a href="https://github.com/mlr-org/mlr3hf">mlr3hf</a>.</p>
<p>You can also visit the <a href="https://mlr-org.github.io/mlr3hf/">package documentation</a>. A development version of the package has been released on <a href="https://mlr-org.r-universe.dev/mlr3hf">r-universe</a>.</p>
<p>We are currently planning to submit the package to <strong>CRAN</strong> after making some final refinements.</p>
<hr>
</section>
<section id="what-is-the-project" class="level2">
<h2 class="anchored" data-anchor-id="what-is-the-project">What Is the Project?</h2>
<p>Before introducing my project, I would like to briefly explain <strong>what Hugging Face is and why datasets from Hugging Face are useful</strong>.</p>
<p><strong>Hugging Face</strong> is a platform that provides a large collection of datasets, models, and other resources that are widely used in machine learning and deep learning. In my project, I mainly focused on the <strong>Hugging Face Hub for datasets</strong>. You can visit the <a href="https://huggingface.co/">Hugging Face website</a> to explore these resources.</p>
<p>So, why do we need these datasets?</p>
<p>Researchers, students, and developers often need datasets to experiment with, develop, and evaluate machine learning models. However, simply downloading a dataset is not always enough. In the <strong>R ecosystem</strong>, users of <code>mlr3</code> work with datasets through a specific abstraction called a <strong>Task</strong>.</p>
<p>An <code>mlr3</code> Task contains the dataset together with information about its <strong>features, target variable, and other relevant metadata</strong>. This allows the dataset to be directly used with the different components of the <code>mlr3</code> ecosystem.</p>
<p>This is where <strong>mlr3hf</strong> comes in.</p>
<p>The goal of my project was to develop an R package that allows users to <strong>access datasets from the Hugging Face Hub and convert them into objects that can be used within the <code>mlr3</code> ecosystem</strong>.</p>
<hr>
</section>
<section id="my-contributions" class="level2">
<h2 class="anchored" data-anchor-id="my-contributions">My Contributions</h2>
<p>Since the project was developed largely from scratch, I worked on several different parts of the package, including dataset downloading, caching, metadata handling, Parquet access, testing, and conversion into <code>mlr3</code> objects.</p>
<p>During GSoC, I opened more than 20 pull requests and issues, covering different aspects of the implementation, testing, documentation, CI, and project infrastructure.</p>
<p>A complete list of my pull requests and issues is provided below.</p>
<hr>
</section>
<section id="pull-requests-and-issues" class="level2">
<h2 class="anchored" data-anchor-id="pull-requests-and-issues">Pull Requests and Issues</h2>
<p>I opened more than 20 pull requests and issues throughout the GSoC period.</p>
<p>Every pull request that I submitted was eventually merged, and there are currently no pending changes from my GSoC work upstream.</p>
<table class="caption-top table">
<thead>
<tr class="header">
<th>PR/Issue</th>
<th>Description</th>
<th>Status</th>
<th>Link</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>PR #3</td>
<td>Implementing dataset downloads and fixing <code>R CMD check</code> issues</td>
<td>Merged</td>
<td><a href="https://github.com/mlr-org/mlr3hf/pull/3">PR #3</a></td>
</tr>
<tr class="even">
<td>PR #4</td>
<td>Adding a dependency for dataset descriptions</td>
<td>Merged</td>
<td><a href="https://github.com/mlr-org/mlr3hf/pull/4">PR #4</a></td>
</tr>
<tr class="odd">
<td>PR #6</td>
<td>Adding <code>pkgdown</code></td>
<td>Merged</td>
<td><a href="https://github.com/mlr-org/mlr3hf/pull/6">PR #6</a></td>
</tr>
<tr class="even">
<td>PR #9</td>
<td>Implementing dataset caching</td>
<td>Merged</td>
<td><a href="https://github.com/mlr-org/mlr3hf/pull/9">PR #9</a></td>
</tr>
<tr class="odd">
<td>PR #10</td>
<td>Adding Netlify integration</td>
<td>Merged</td>
<td><a href="https://github.com/mlr-org/mlr3hf/pull/10">PR #10</a></td>
</tr>
<tr class="even">
<td>PR #12</td>
<td>Adding GitHub Pages and preview comments to show changes</td>
<td>Merged</td>
<td><a href="https://github.com/mlr-org/mlr3hf/pull/12">PR #12</a></td>
</tr>
<tr class="odd">
<td>PR #15</td>
<td>Implementing <code>list_datasets()</code></td>
<td>Merged</td>
<td><a href="https://github.com/mlr-org/mlr3hf/pull/15">PR #15</a></td>
</tr>
<tr class="even">
<td>PR #16</td>
<td>Removing the built-in container from the workflows</td>
<td>Merged</td>
<td><a href="https://github.com/mlr-org/mlr3hf/pull/16">PR #16</a></td>
</tr>
<tr class="odd">
<td>PR #20</td>
<td>Fixing <code>skip()</code> and adding <code>vcr</code></td>
<td>Merged</td>
<td><a href="https://github.com/mlr-org/mlr3hf/pull/20">PR #20</a></td>
</tr>
<tr class="even">
<td>PR #22</td>
<td>Adding the caching design documentation</td>
<td>Merged</td>
<td><a href="https://github.com/mlr-org/mlr3hf/pull/22">PR #22</a></td>
</tr>
<tr class="odd">
<td>PR #25</td>
<td>Resolving <a href="https://github.com/mlr-org/mlr3hf/issues/24">Issue #24</a></td>
<td>Merged</td>
<td><a href="https://github.com/mlr-org/mlr3hf/pull/25">PR #25</a></td>
</tr>
<tr class="even">
<td>PR #26</td>
<td>Adding <code>backend_parquet.R</code> and <code>backend_hfhub.R</code></td>
<td>Merged</td>
<td><a href="https://github.com/mlr-org/mlr3hf/pull/26">PR #26</a></td>
</tr>
<tr class="odd">
<td>PR #27</td>
<td>Task creation and vignettes</td>
<td>Merged</td>
<td><a href="https://github.com/mlr-org/mlr3hf/pull/27">PR #27</a></td>
</tr>
<tr class="even">
<td>PR #29</td>
<td>fixing file_name in url</td>
<td>Merged</td>
<td><a href="https://github.com/mlr-org/mlr3hf/pull/29">PR #29</a></td>
</tr>
<tr class="odd">
<td>PR #30</td>
<td>solving <a href="https://github.com/mlr-org/mlr3hf/pull/17">issues 17</a></td>
<td>Merged</td>
<td><a href="https://github.com/mlr-org/mlr3hf/pull/30">PR #30</a></td>
</tr>
<tr class="even">
<td>PR #33</td>
<td>correcting subdirectory file_name</td>
<td>Merged</td>
<td><a href="https://github.com/mlr-org/mlr3hf/pull/33">PR #33</a></td>
</tr>
</tbody>
</table>
<hr>
</section>
<section id="challenges-i-faced" class="level2">
<h2 class="anchored" data-anchor-id="challenges-i-faced">Challenges I Faced</h2>
<p>The biggest challenge for me was not writing individual functions. It was <strong>making design decisions</strong>.</p>
<p>When developing a package from scratch, there are often several ways to solve the same problem. Choosing one approach requires thinking about future users, maintainability, performance, edge cases, and how the different components of the package will interact.</p>
<p>The caching design was a particularly challenging part.</p>
<p>I also had to learn how real open-source projects work:</p>
<ul>
<li>understanding an existing codebase,</li>
<li>reading documentation and source code,</li>
<li>discussing design decisions,</li>
<li>writing tests,</li>
<li>responding to code review,</li>
<li>debugging unexpected behavior,</li>
<li>and thinking about how future contributors will understand the code.</li>
</ul>
<p>At several points, I was unsure whether my approach was the right one. Instead of simply giving me the answer, my mentors encouraged me to think through the problem and explain my reasoning.</p>
<p>That process helped me become more comfortable with uncertainty.</p>
<p>I learned that <strong>not knowing the answer immediately is normal in software engineering</strong>. What matters is developing the ability to investigate, reason, experiment, discuss, and eventually arrive at a good solution.</p>
<hr>
</section>
<section id="what-i-learned-beyond-technical-skills" class="level2">
<h2 class="anchored" data-anchor-id="what-i-learned-beyond-technical-skills">What I Learned Beyond Technical Skills</h2>
<p>GSoC taught me several things that I don’t think I could have learned as effectively from a course or textbook.</p>
<section id="how-to-communicate-with-mentors" class="level3">
<h3 class="anchored" data-anchor-id="how-to-communicate-with-mentors">1. How to Communicate With Mentors</h3>
<p>Before GSoC, I did not have much experience discussing technical problems with experienced software developers.</p>
<p>I learned how to explain:</p>
<ul>
<li>what I understood,</li>
<li>what I had tried,</li>
<li>where I was stuck,</li>
<li>why I preferred a particular approach,</li>
<li>and what trade-offs I was considering.</li>
</ul>
<p>This made my technical communication much clearer.</p>
</section>
<section id="think-independently" class="level3">
<h3 class="anchored" data-anchor-id="think-independently">2. Think Independently</h3>
<p>My mentors gave me significant freedom to explore solutions before discussing them.</p>
<p>This taught me to first ask myself:</p>
<blockquote class="blockquote">
<p>“What do I think the solution should be, and why?”</p>
</blockquote>
<p>Only after developing my own understanding would I discuss it with my mentors.</p>
<p>This habit has become one of the most valuable outcomes of GSoC for me.</p>
<hr>
</section>
</section>
<section id="current-state-of-the-package" class="level2">
<h2 class="anchored" data-anchor-id="current-state-of-the-package">Current State of the Package</h2>
<p>At the end of GSoC, the major planned components of the project have been implemented.</p>
<p>The package currently provides functionality for downloading and accessing datasets from Hugging Face, caching them locally, working with different revisions, and converting the data into objects usable by the mlr3 ecosystem.</p>
<p>However, I do not consider the project “finished,” in the sense that no software project is ever completely finished.</p>
<p>A few concrete areas remain open for future work:</p>
<ul>
<li>support for additional dataset formats beyond Parquet, csv and tsv,</li>
<li>broader test coverage for edge cases in the caching layer,</li>
<li>and continued documentation updates as the mlr3 ecosystem evolves.</li>
</ul>
<p>If you find a bug, or see an area that can be improved, raise an <a href="https://github.com/mlr-org/mlr3hf/issues">issue</a>, contributions are welcome.</p>
<hr>
</section>
<section id="acknowledgements" class="level2">
<h2 class="anchored" data-anchor-id="acknowledgements">Acknowledgements</h2>
<p>I sincerely acknowledge my mentors, <strong>Toby Dylan Hocking</strong> and <strong>Sebastian Fischer</strong>, for their guidance and support throughout this journey. I am also grateful to <strong>The R Project for Statistical Computing</strong> for providing me with the opportunity to be part of this experience.</p>
<p>However, I want to acknowledge my mentors for something beyond simply helping me complete the project.I would also like to acknowledge the <strong>Hugging Face documentation</strong>, and the other dependencies used by this package, which were valuable resources throughout the development of <code>mlr3hf</code>.</p>
<hr>


</section>

 ]]></description>
  <category>GSOC</category>
  <category>Statistical Computing</category>
  <category>R</category>
  <category>Open Source Contribution</category>
  <category>Hugging Face</category>
  <category>Nanoparquet</category>
  <category>Parquet</category>
  <guid>https://mlr3hf-blog.netlify.app/posts/gsoc-report/</guid>
  <pubDate>Thu, 20 Aug 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Google Summer of Code 2026 – Progress Report (till Week 10)</title>
  <dc:creator>Anjani Nandan</dc:creator>
  <link>https://mlr3hf-blog.netlify.app/posts/post-8/</link>
  <description><![CDATA[ 





<section id="overview" class="level2">
<h2 class="anchored" data-anchor-id="overview">Overview</h2>
<p>We are now in the final stage of the <code>mlr3hf</code> project, and almost everything planned for this week has been completed.</p>
<p>The complete implementation is available in the <a href="https://www.github.com/anjaninandan001/mlr3hf">mlr3hf repository</a>.</p>
<p>During the final phase, I focused mainly on improving the <strong>user experience</strong>, documentation, and integration with the <code>mlr3</code> ecosystem.</p>
<p>Some of the important additions and improvements include:</p>
<ul>
<li><code>tutorial.Rmd</code> and <code>quick-revision.Rmd</code> in the <code>vignettes/</code> directory</li>
<li><code>sugar.R</code> containing user-friendly helper functions</li>
<li><code>zzz.R</code> containing package imports and related package-level definitions</li>
<li>Active bindings in <code>HFData.R</code></li>
<li>Direct conversion of Hugging Face datasets into <code>mlr3</code> tasks</li>
<li>Support for predefined train, test, and validation splits</li>
</ul>
<p>The goal throughout the project has been to make working with Hugging Face datasets as simple as possible for an <code>R</code> user.</p>
<hr>
</section>
<section id="documentation-and-package-structure" class="level2">
<h2 class="anchored" data-anchor-id="documentation-and-package-structure">Documentation and Package Structure</h2>
<p>The package now contains two important vignettes:</p>
<ul>
<li><code>tutorial.Rmd</code></li>
<li><code>quick-revision.Rmd</code></li>
</ul>
<p>The <strong>tutorial</strong> provides a detailed introduction to using <code>mlr3hf</code>, while the <strong>quick revision</strong> vignette gives users a shorter overview of the package and its main functionality.</p>
<p>I also added <code>sugar.R</code> and <code>zzz.R</code>.</p>
<p>The <code>sugar.R</code> file contains user-friendly helper functions such as <code>hfdata()</code>, while <code>zzz.R</code> is used for package-level definitions such as <code>@importFrom</code> statements.</p>
<p>This keeps the package structure clean and makes the user-facing functions easier to discover.</p>
<hr>
</section>
<section id="user-friendly-access-with-hfdata" class="level2">
<h2 class="anchored" data-anchor-id="user-friendly-access-with-hfdata">User-Friendly Access with <code>HFData</code></h2>
<p>One of the major parts of the package is the <code>HFData</code> class.</p>
<p>The class provides several <strong>active bindings</strong> that allow users to access useful information about a Hugging Face dataset without having to manually interact with the Hugging Face API.</p>
<p>The available active bindings are:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 19%">
<col style="width: 80%">
</colgroup>
<thead>
<tr class="header">
<th>Binding</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>nrow</code></td>
<td>Number of rows in the dataset</td>
</tr>
<tr class="even">
<td><code>ncol</code></td>
<td>Number of columns in the dataset</td>
</tr>
<tr class="odd">
<td><code>repo_link</code></td>
<td>URL of the dataset repository on Hugging Face</td>
</tr>
<tr class="even">
<td><code>desc</code></td>
<td>Repository description, including siblings, configs, and tags</td>
</tr>
<tr class="odd">
<td><code>storage</code></td>
<td>Storage information for the repository</td>
</tr>
<tr class="even">
<td><code>configs</code></td>
<td>All configurations available in the repository</td>
</tr>
<tr class="odd">
<td><code>siblings</code></td>
<td>All filenames contained in the repository</td>
</tr>
<tr class="even">
<td><code>data</code></td>
<td>Loaded dataset</td>
</tr>
<tr class="odd">
<td><code>colnames</code></td>
<td>Names of all columns in the dataset</td>
</tr>
<tr class="even">
<td><code>splits</code></td>
<td>Available dataset splits as row ID lists</td>
</tr>
<tr class="odd">
<td><code>coltypes</code></td>
<td>Data type of each column</td>
</tr>
<tr class="even">
<td><code>feature_names</code></td>
<td>Column names excluding the target column</td>
</tr>
</tbody>
</table>
<p>For example, we can create an <code>HFData</code> object using:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1">hf_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">hfdata</span>(</span>
<span id="cb1-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">repo_id =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"scikit-learn/iris"</span>,</span>
<span id="cb1-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">config =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"default"</span>,</span>
<span id="cb1-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Species"</span></span>
<span id="cb1-5">)</span></code></pre></div></div>
<p>The active bindings can then be accessed directly:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1">hf_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>repo_link</span>
<span id="cb2-2">hf_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>configs</span>
<span id="cb2-3">hf_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>siblings</span></code></pre></div></div>
<p>For example, <code>repo_link</code> directly returns the URL of the dataset repository on Hugging Face. This URL can then be opened in a browser to inspect the dataset repository.</p>
<p>Similarly, <code>configs</code> returns all configurations available for the dataset, while <code>siblings</code> returns the filenames available in the repository.</p>
<p>This makes it possible to explore a Hugging Face dataset directly from R without manually navigating through the Hugging Face API.</p>
<hr>
</section>
<section id="creating-an-mlr3-task-directly" class="level2">
<h2 class="anchored" data-anchor-id="creating-an-mlr3-task-directly">Creating an <code>mlr3</code> Task Directly</h2>
<p>One of the main goals of <code>mlr3hf</code> is to make Hugging Face datasets immediately usable within the <code>mlr3</code> ecosystem.</p>
<p>With the package, a user can create an <code>mlr3</code> task directly:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1">hf_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">task</span>(</span>
<span id="cb3-2">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hf"</span>,</span>
<span id="cb3-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">repo_id =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"scikit-learn/iris"</span>,</span>
<span id="cb3-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">config =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"default"</span>,</span>
<span id="cb3-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Species"</span></span>
<span id="cb3-6">)</span></code></pre></div></div>
<p>The resulting object is an <code>mlr3</code> task and can be directly used with the rest of the <code>mlr3</code> ecosystem.</p>
<p>For example, it can be passed to learners, resampling strategies, prediction workflows, and performance measures.</p>
<p>This removes several manual steps that would otherwise be required to download a dataset, load it into R, identify the target column, and construct an <code>mlr3</code> task.</p>
<hr>
</section>
<section id="hfdata" class="level2">
<h2 class="anchored" data-anchor-id="hfdata"><code>hfdata()</code></h2>
<p>We also provide a user-friendly helper function, <code>hfdata()</code>.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1">hf_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">hfdata</span>(</span>
<span id="cb4-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">repo_id =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"scikit-learn/iris"</span>,</span>
<span id="cb4-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">config =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"default"</span>,</span>
<span id="cb4-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Species"</span></span>
<span id="cb4-5">)</span></code></pre></div></div>
<p>The <code>hfdata()</code> function provides direct access to the <code>HFData</code> object and its active bindings.</p>
<p>For example:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1">hf_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>repo_link</span>
<span id="cb5-2">hf_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>configs</span>
<span id="cb5-3">hf_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>siblings</span>
<span id="cb5-4">hf_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>data</span>
<span id="cb5-5">hf_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>colnames</span>
<span id="cb5-6">hf_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>coltypes</span>
<span id="cb5-7">hf_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>feature_names</span></code></pre></div></div>
<p>Some of these bindings can even be used when only the <code>repo_id</code> is provided.</p>
<p>For example, information such as the repository URL, configurations, and repository files does not require the user to specify a target column.</p>
<p>This makes <code>HFData</code> useful not only for model training, but also for <strong>exploring and understanding a Hugging Face dataset before using it</strong>.</p>
<hr>
</section>
<section id="working-with-predefined-dataset-splits" class="level1">
<h1>Working with Predefined Dataset Splits</h1>
<p>Another useful feature of <code>mlr3hf</code> is support for predefined dataset splits.</p>
<p>Many Hugging Face datasets already provide predefined <code>train</code>, <code>test</code>, and sometimes <code>validation</code> splits.</p>
<p>Instead of creating a new resampling split, <code>mlr3hf</code> exposes these predefined splits through the <code>$splits</code> active binding.</p>
<p>The splits are represented as vectors of row IDs, which means they can be directly reused in <code>mlr3</code> workflows.</p>
<p>For example:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(mlr3learners)</span>
<span id="cb6-2"></span>
<span id="cb6-3">hf_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">hfdata</span>(</span>
<span id="cb6-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">repo_id =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a4n9i/scikit_iris"</span>,</span>
<span id="cb6-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">config =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"default"</span>,</span>
<span id="cb6-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">target =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Species"</span></span>
<span id="cb6-7">)</span>
<span id="cb6-8"></span>
<span id="cb6-9">task <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_task</span>(hf_data)</span>
<span id="cb6-10"></span>
<span id="cb6-11">train_row_id <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> hf_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>splits<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>train</span>
<span id="cb6-12">test_row_id  <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> hf_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>splits<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>test</span></code></pre></div></div>
<p>We can then pass these row IDs directly to <code>ResamplingCustom</code>.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1">resampling <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rsmp</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"custom"</span>)</span>
<span id="cb7-2"></span>
<span id="cb7-3">resampling<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">instantiate</span>(</span>
<span id="cb7-4">  task,</span>
<span id="cb7-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">train_sets =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(train_row_id),</span>
<span id="cb7-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">test_sets =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(test_row_id)</span>
<span id="cb7-7">)</span>
<span id="cb7-8"></span>
<span id="cb7-9">resampling</span></code></pre></div></div>
<p>This produces:</p>
<pre class="text"><code>## ──  : Custom Splits ──────────────────────────────────────────
## • Iterations: 1
## • Instantiated: TRUE
## • Parameters: list()</code></pre>
<p>The resulting resampling object can be used like any other <code>mlr3</code> resampling strategy:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1">rr <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">resample</span>(</span>
<span id="cb9-2">  task,</span>
<span id="cb9-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">lrn</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"classif.rpart"</span>),</span>
<span id="cb9-4">  resampling</span>
<span id="cb9-5">)</span>
<span id="cb9-6"></span>
<span id="cb9-7">rr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aggregate</span>()</span></code></pre></div></div>
<p>For example:</p>
<pre class="text"><code>## classif.ce
## 0.6333333</code></pre>
<p>The important point here is that we are <strong>reusing the original train/test split provided by the dataset</strong>, rather than generating a new random split.</p>
<p>This is especially useful when a dataset creator has already defined meaningful training and evaluation splits.</p>
<hr>
</section>
<section id="using-a-predefined-validation-split" class="level1">
<h1>Using a Predefined Validation Split</h1>
<p>Some Hugging Face datasets also provide a predefined <code>validation</code> split.</p>
<p>This can be particularly useful for learners that support internal validation.</p>
<p>For example, <code>classif.xgboost</code> can use an internal validation task for early stopping and monitoring validation performance.</p>
<p>First, we extract the predefined splits:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1">train_ids <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> hf_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>splits<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>train</span>
<span id="cb11-2">valid_ids <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> hf_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>splits<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>validation</span>
<span id="cb11-3">test_ids  <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> hf_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>splits<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>test</span></code></pre></div></div>
<p>We then create a training task containing only the training rows:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1">tsk_train <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> task<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">clone</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">deep =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb12-2">tsk_train<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(train_ids)</span></code></pre></div></div>
<p>Similarly, we create a separate validation task:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1">tsk_valid <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> task<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">clone</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">deep =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb13-2">tsk_valid<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(valid_ids)</span></code></pre></div></div>
<p>The validation task can then be attached to the training task:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1">tsk_train<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>internal_valid_task <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> tsk_valid</span></code></pre></div></div>
<p>Now we create an XGBoost learner:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1">lrn <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">lrn</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"classif.xgboost"</span>)</span></code></pre></div></div>
<p>We tell the learner to use the predefined validation task:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1">lrn<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>validate <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"predefined"</span></span></code></pre></div></div>
<p>We can then configure early stopping and the evaluation metric:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb17-1">lrn<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>param_set<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">set_values</span>(</span>
<span id="cb17-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nrounds =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span>,</span>
<span id="cb17-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">early_stopping_rounds =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>,</span>
<span id="cb17-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">eval_metric =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mlogloss"</span></span>
<span id="cb17-5">)</span></code></pre></div></div>
<p>Finally, we train the learner:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb18-1">lrn<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">train</span>(tsk_train)</span></code></pre></div></div>
<p>The validation score can be inspected using:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb19-1">lrn<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>internal_valid_scores</span></code></pre></div></div>
<p>For example:</p>
<pre class="text"><code>## $mlogloss
## [1] 13.82791</code></pre>
<p>After training, we can evaluate the model on the predefined test split:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb21-1">tsk_test <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> task<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">clone</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">deep =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb21-2">tsk_test<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(test_ids)</span>
<span id="cb21-3"></span>
<span id="cb21-4">pred <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> lrn<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">predict</span>(tsk_test)</span>
<span id="cb21-5"></span>
<span id="cb21-6">pred<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">score</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">msr</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"classif.ce"</span>))</span></code></pre></div></div>
<p>For example:</p>
<pre class="text"><code>## classif.ce
## 0.6333333</code></pre>
<p>A <code>learner</code> such as <code>classif.rpart</code> does not use <code>internal_valid_task</code>, whereas learners such as <code>classif.xgboost</code> can use it for internal validation and early stopping.</p>
<hr>
</section>
<section id="keeping-the-user-perspective-in-mind" class="level1">
<h1>Keeping the User Perspective in Mind</h1>
<p>Throughout the development of <code>mlr3hf</code>, one of the most important things we tried to keep in mind was the <strong>user perspective</strong>.</p>
<p>The goal was not simply to build another interface for downloading Hugging Face datasets.</p>
<p>Instead, we wanted to answer a more practical question:</p>
<blockquote class="blockquote">
<p>How can an R user take a dataset from Hugging Face and start using it in the <code>mlr3</code> ecosystem with as little effort as possible?</p>
</blockquote>
<p>This led to features such as:</p>
<ul>
<li>Direct creation of <code>mlr3</code> tasks</li>
<li><code>hfdata()</code> for convenient dataset access</li>
<li>Active bindings for dataset exploration</li>
<li>Support for predefined train/test/validation splits</li>
<li>Reuse of existing dataset splits instead of unnecessarily creating new ones</li>
</ul>
<p>The intention is to make the workflow feel natural for an R user.</p>
<hr>
</section>
<section id="acknowledgements" class="level1">
<h1>Acknowledgements</h1>
<p>I would like to sincerely thank my mentors, <strong>Toby Dylan Hocking</strong> and <strong>Sebastian Fischer</strong>, for their guidance and support throughout this project.</p>
<p>Their feedback and discussions helped me understand the project from both a technical and a user-oriented perspective.</p>
<p>Whenever we discussed a feature or design decision, we tried to keep one question in mind:</p>
<blockquote class="blockquote">
<p><strong>How will this help the user?</strong></p>
</blockquote>
<p>That mindset had a significant influence on the final design of <code>mlr3hf</code>.</p>
<p>I am very grateful for the opportunity to work on this project and learn from both of my mentors.</p>
<p>We have now reached the final stage of the project, and I hope that <code>mlr3hf</code> will be useful to R users and researchers who want to work with datasets available on Hugging Face.</p>
<p>It has been a challenging but rewarding journey, and I am happy with what we have built together.</p>
<p><strong>We built it with love for the R and <code>mlr3</code> community. ❤️</strong></p>


</section>

 ]]></description>
  <category>gsoc</category>
  <category>mlr3hf</category>
  <category>caching</category>
  <category>symlink</category>
  <category>parquet</category>
  <category>R6 class</category>
  <guid>https://mlr3hf-blog.netlify.app/posts/post-8/</guid>
  <pubDate>Sun, 09 Aug 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Google Summer of Code 2026 – Progress Report (till Week 6)</title>
  <dc:creator>Anjani Nandan</dc:creator>
  <link>https://mlr3hf-blog.netlify.app/posts/post-7/</link>
  <description><![CDATA[ 





<section id="overview" class="level2">
<h2 class="anchored" data-anchor-id="overview">Overview</h2>
<p>During the first six weeks of GSoC, I focused on building the core infrastructure for <strong>mlr3hf</strong>, with the primary goal of providing efficient dataset downloading, caching, and metadata management for Hugging Face datasets in R.</p>
<hr>
</section>
<section id="implemented-a-hugging-face-style-caching-system" class="level2">
<h2 class="anchored" data-anchor-id="implemented-a-hugging-face-style-caching-system">1. Implemented a Hugging Face-style Caching System</h2>
<p>I initially started by implementing <code>cache.R</code>, but after several design discussions with mentors, I redesigned the caching mechanism to closely follow the architecture used by the Hugging Face Hub. This provides a more robust and maintainable solution while remaining familiar to users already working with Hugging Face.</p>
<p>The cache is organized under <code>~/.cache/huggingface/</code> and contains two separate caches.</p>
<section id="hub-cache-canonical-datasets" class="level3">
<h3 class="anchored" data-anchor-id="hub-cache-canonical-datasets">Hub Cache (Canonical Datasets)</h3>
<pre class="text"><code>~/.cache/huggingface/
└── hub/
    └── &lt;repo_name&gt;/
        ├── blobs/
        │   └── &lt;etag&gt;                  # actual downloaded file
        │
        ├── snapshots/
        │   └── &lt;commit_hash&gt;/
        │       └── &lt;file_name&gt;         # symlink/copy → ../../blobs/&lt;etag&gt;
        │
        └── refs/
            └── &lt;branch_or_tag&gt;         # contains commit hash</code></pre>
<p>Features:</p>
<ul>
<li>Stores downloaded canonical dataset files.</li>
<li>Uses <strong>blobs</strong>, <strong>snapshots</strong>, and <strong>refs</strong> similar to the official Hugging Face cache.</li>
<li>Prevents duplicate downloads.</li>
<li>Supports repository revisions through commit hashes.</li>
</ul>
<p>Example:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1">dataset <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cache_hfhub</span>(</span>
<span id="cb2-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">repo_id =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"scikit-learn/iris"</span>,</span>
<span id="cb2-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">file_name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Iris.csv"</span></span>
<span id="cb2-4">)</span></code></pre></div></div>
</section>
<section id="parquet-cache" class="level3">
<h3 class="anchored" data-anchor-id="parquet-cache">Parquet Cache</h3>
<pre class="text"><code>~/.cache/huggingface/
└── datasets/
    └── &lt;repo_folder&gt;/
        └── &lt;config&gt;/
            ├── train/
            │   ├── blobs/
            │   │   └── &lt;etag&gt;
            │   └── snapshots/
            │       └── &lt;commit_hash&gt;/
            │           └── &lt;filename&gt;.parquet
            │
            ├── test/
            │   ├── blobs/
            │   └── snapshots/
            │
            └── validation/
                ├── blobs/
                └── snapshots/</code></pre>
<p>Each dataset split maintains:</p>
<ul>
<li>blobs</li>
<li>snapshots</li>
<li>commit-based versioning</li>
</ul>
<p>Example:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1">dataset <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cache_parquet</span>(</span>
<span id="cb4-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">repo_id =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"scikit-learn/iris"</span>,</span>
<span id="cb4-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">config =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"default"</span></span>
<span id="cb4-4">)</span></code></pre></div></div>
<p>This implementation enables efficient storage, avoids redundant downloads, and follows the same overall design philosophy as Hugging Face’s caching system.</p>
<hr>
</section>
</section>
<section id="implemented-list_datasets" class="level2">
<h2 class="anchored" data-anchor-id="implemented-list_datasets">2. Implemented <code>list_datasets()</code></h2>
<p>I implemented <code>list_datasets()</code>, allowing users to search datasets directly from the Hugging Face Hub.</p>
<p>Example:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list_datasets</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">search =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"machine-learning"</span>)</span></code></pre></div></div>
<p>The function supports keyword-based dataset discovery and returns matching repositories, making it easier for users to explore datasets directly from R.</p>
<hr>
</section>
<section id="implemented-download_desc" class="level2">
<h2 class="anchored" data-anchor-id="implemented-download_desc">3. Implemented <code>download_desc()</code></h2>
<p>I implemented <code>download_desc.R</code>, which retrieves repository metadata before downloading any files.</p>
<p>The function provides useful information such as:</p>
<ul>
<li>Available files in the repository</li>
<li>File names</li>
<li>Total storage</li>
</ul>
<p>This metadata will also be integrated into the <code>HFData</code> R6 class so that users can inspect repository details during object initialization.</p>
<hr>
</section>
<section id="developed-the-initial-version-of-hfdata" class="level2">
<h2 class="anchored" data-anchor-id="developed-the-initial-version-of-hfdata">4. Developed the Initial Version of <code>HFData</code></h2>
<p>I have completed a working implementation of <code>HFData.R</code>.</p>
<p>Before cleaning and refactoring the code, I will test it extensively on multiple Hugging Face datasets to identify implementation issues and edge cases. This testing phase helped improve the overall reliability of the backend before finalizing the public API.</p>
<hr>
</section>
<section id="testing" class="level2">
<h2 class="anchored" data-anchor-id="testing">5. Testing</h2>
<p>A significant amount of work has gone into writing unit tests.</p>
<section id="current-test-coverage" class="level3">
<h3 class="anchored" data-anchor-id="current-test-coverage">Current Test Coverage</h3>
<table class="caption-top table">
<thead>
<tr class="header">
<th>File</th>
<th style="text-align: right;">Lines</th>
<th style="text-align: right;">Relevant</th>
<th style="text-align: right;">Covered</th>
<th style="text-align: right;">Missed</th>
<th style="text-align: right;">Coverage</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>R/cache_hfhub.R</code></td>
<td style="text-align: right;">192</td>
<td style="text-align: right;">83</td>
<td style="text-align: right;">43</td>
<td style="text-align: right;">40</td>
<td style="text-align: right;"><strong>51.81%</strong></td>
</tr>
<tr class="even">
<td><code>R/defaults.R</code></td>
<td style="text-align: right;">40</td>
<td style="text-align: right;">20</td>
<td style="text-align: right;">16</td>
<td style="text-align: right;">4</td>
<td style="text-align: right;"><strong>80.00%</strong></td>
</tr>
<tr class="odd">
<td><code>R/cache_parquet.R</code></td>
<td style="text-align: right;">201</td>
<td style="text-align: right;">92</td>
<td style="text-align: right;">77</td>
<td style="text-align: right;">15</td>
<td style="text-align: right;"><strong>83.70%</strong></td>
</tr>
<tr class="even">
<td><code>R/utils.R</code></td>
<td style="text-align: right;">225</td>
<td style="text-align: right;">107</td>
<td style="text-align: right;">98</td>
<td style="text-align: right;">9</td>
<td style="text-align: right;"><strong>91.59%</strong></td>
</tr>
<tr class="odd">
<td><code>R/download_desc.R</code></td>
<td style="text-align: right;">38</td>
<td style="text-align: right;">16</td>
<td style="text-align: right;">16</td>
<td style="text-align: right;">0</td>
<td style="text-align: right;"><strong>100.00%</strong></td>
</tr>
</tbody>
</table>
<p><strong>Overall test coverage:</strong> <strong>81.42%</strong></p>
<p>My next target is to increase the overall test coverage to <strong>90%+</strong>, with particular focus on improving coverage for <code>cache_hfhub.R</code>.</p>
<hr>
</section>
</section>
<section id="development-infrastructure" class="level2">
<h2 class="anchored" data-anchor-id="development-infrastructure">6. Development Infrastructure</h2>
<p>In addition to implementing the package functionality, I also implemented overall development workflow by:</p>
<ul>
<li>Resolving <code>R CMD check</code> issues.</li>
<li>Configuring automated documentation generation.</li>
<li>Setting up <strong>pkgdown</strong>.</li>
<li>Deploying the documentation using <strong>GitHub Pages</strong> and <strong>Netlify</strong>.</li>
<li>Improving the package structure and development workflow.</li>
</ul>
<hr>
</section>
<section id="current-status" class="level2">
<h2 class="anchored" data-anchor-id="current-status">Current Status</h2>
<p>The core backend infrastructure is now functional.</p>
<p>The following components have been implemented:</p>
<ul>
<li><code>cache_parquet()</code></li>
<li><code>cache_hfhub()</code></li>
<li><code>list_datasets()</code></li>
<li><code>download_desc()</code></li>
<li>Unit testing framework</li>
<li>Documentation infrastructure</li>
<li>CI setup and package website deployment</li>
</ul>
<p>The project has now reached the stage where the backend infrastructure is largely complete, allowing future work to focus on usability, benchmarking, and polishing the user experience.</p>
<hr>
</section>
<section id="goals-for-the-next-phase" class="level2">
<h2 class="anchored" data-anchor-id="goals-for-the-next-phase">Goals for the Next Phase</h2>
<p>The next milestones are:</p>
<ul>
<li><strong><code>HFData.R</code> implementation.</strong></li>
<li>Increase unit test coverage to <strong>90%+</strong>.</li>
<li>Benchmark overall code implementations and evaluate their performance.</li>
<li>Update and correct the documentation to reflect the latest API changes.</li>
<li>Add more examples and improve the overall user documentation before the final release.</li>
</ul>


</section>

 ]]></description>
  <category>gsoc</category>
  <category>mlr3hf</category>
  <category>caching</category>
  <category>symlink</category>
  <category>parquet</category>
  <guid>https://mlr3hf-blog.netlify.app/posts/post-7/</guid>
  <pubDate>Wed, 08 Jul 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Building mlr3hf: Downloading and Exploring Hugging Face Datasets</title>
  <dc:creator>Anjani Nandan</dc:creator>
  <link>https://mlr3hf-blog.netlify.app/posts/post-6/</link>
  <description><![CDATA[ 





<p>The <code>mlr3hf</code> package is currently under active development. Its goal is to make Hugging Face datasets easily accessible within the <code>mlr3</code> ecosystem. Although the package is not yet complete, several core components have already been implemented.</p>
<p>In this post, I introduce some of the current functionality, including downloading datasets, caching them locally, listing available datasets, and retrieving repository metadata. The examples below demonstrate the current development API, which may evolve before the first stable release.</p>
<section id="cache_parquet.r" class="level2">
<h2 class="anchored" data-anchor-id="cache_parquet.r"><code>cache_parquet.R</code></h2>
<p>Many datasets on Hugging Face are available through the <code>refs/convert/parquet</code> branch, which contains automatically generated Parquet files. Since Parquet is an efficient storage format and integrates well with analytical backends, <code>mlr3hf</code> downloads datasets from this branch whenever possible.</p>
<p>The <code>cache_parquet()</code> function downloads Parquet datasets and stores them in the local cache. It currently exposes the following arguments:</p>
<ul>
<li><code>repo_id</code></li>
<li><code>config</code></li>
<li><code>revision</code></li>
<li><code>split</code></li>
</ul>
<p>If <code>revision</code> is not specified, the latest version of the dataset is downloaded. To reproduce an older version of a dataset, simply provide the corresponding commit hash through the <code>revision</code> argument.</p>
<section id="download-the-latest-version" class="level3">
<h3 class="anchored" data-anchor-id="download-the-latest-version">Download the latest version</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1">dataset.latest <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cache_parquet</span>(</span>
<span id="cb1-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">repo_id =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a4n9i/iris-tabular"</span>,</span>
<span id="cb1-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">config =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"default"</span></span>
<span id="cb1-4">)</span>
<span id="cb1-5"></span>
<span id="cb1-6">dataset.latest</span></code></pre></div></div>
</div>
<p><strong>Expected output</strong></p>
<pre class="text"><code>$train
[1] "~/.cache/huggingface/datasets/datasets--a4n9i--iris-tabular/default/train/snapshots/f408ebffc0876b0f284fa4c90453e52e43c67677/0000.parquet"</code></pre>
<p>The returned path points to the cached Parquet file on the local machine.</p>
</section>
<section id="download-a-specific-revision" class="level3">
<h3 class="anchored" data-anchor-id="download-a-specific-revision">Download a specific revision</h3>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1">dataset.old <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cache_parquet</span>(</span>
<span id="cb3-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">repo_id =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a4n9i/iris-tabular"</span>,</span>
<span id="cb3-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">config =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"default"</span>,</span>
<span id="cb3-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">revision =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d8ba9e5adfa0070361298ae66161ca0b26e78806"</span></span>
<span id="cb3-5">)</span>
<span id="cb3-6"></span>
<span id="cb3-7">dataset.old</span></code></pre></div></div>
</div>
<p><strong>Expected output</strong></p>
<pre class="text"><code>$train
[1] "~/.cache/huggingface/datasets/datasets--a4n9i--iris-tabular/default/train/snapshots/d8ba9e5adfa0070361298ae66161ca0b26e78806/0000.parquet"</code></pre>
<p>Supporting revisions ensures that users can always retrieve a specific version of a dataset, making experiments reproducible.</p>
</section>
</section>
<section id="cache_hfhub.r" class="level2">
<h2 class="anchored" data-anchor-id="cache_hfhub.r"><code>cache_hfhub.R</code></h2>
<p>Not every dataset on Hugging Face is available as Parquet. Some repositories contain datasets in their original formats, such as CSV or JSON.</p>
<p>The internal function <code>cache_hfhub()</code> downloads these canonical dataset files directly from the Hugging Face Hub. Although this is currently an internal helper function, it provides the foundation for supporting repositories that do not contain Parquet files.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1">dataset <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cache_hfhub</span>(</span>
<span id="cb5-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">repo_id =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a4n9i/iris-tabular"</span>,</span>
<span id="cb5-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">file_name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"iris.csv"</span></span>
<span id="cb5-4">)</span>
<span id="cb5-5"></span>
<span id="cb5-6">dataset</span></code></pre></div></div>
</div>
<p><strong>Expected output</strong></p>
<pre class="text"><code>~/.cache/huggingface/hub/datasets--a4n9i--iris-tabular/snapshots/e97efa4eb2e5a170a564aa2d05597c7fc8ac8a4c/iris.csv</code></pre>
<p>Like <code>cache_parquet()</code>, this function also supports downloading datasets from different branches or specific commit revisions.</p>
</section>
<section id="list_datasets.r" class="level2">
<h2 class="anchored" data-anchor-id="list_datasets.r"><code>list_datasets.R</code></h2>
<p>Finding an appropriate dataset is the first step before downloading it.</p>
<p>The <code>list_datasets()</code> function retrieves datasets from the Hugging Face Datasets API and returns a summary containing useful information, including:</p>
<ul>
<li>Dataset ID</li>
<li>Whether the dataset is gated</li>
<li>Number of downloads</li>
</ul>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1">dataset_list <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list_datasets</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span>
<span id="cb7-2"></span>
<span id="cb7-3">dataset_list</span></code></pre></div></div>
</div>
<p><strong>Expected output</strong></p>
<pre class="text"><code>                                    id  gated downloads
                                &lt;char&gt; &lt;char&gt;     &lt;int&gt;
1:       Glint-Research/Fable-5-traces  FALSE     19185
2: armand0e/claude-fable-5-claude-code  FALSE      7978
3:      lazarus19/Vibe-Coding-Instruct  FALSE      1709
4:                       XDOF/ABC-130k   auto     87103
5:                  LocalLaws/LOCUS-v1  FALSE      1130</code></pre>
<p>In future versions of <code>mlr3hf</code>, I also plan to expose additional metadata such as the number of rows and columns whenever that information is available.</p>
</section>
<section id="download_desc.r" class="level2">
<h2 class="anchored" data-anchor-id="download_desc.r"><code>download_desc.R</code></h2>
<p>Another internal helper function is <code>download_desc()</code>, which retrieves repository metadata from Hugging Face.</p>
<p>This information is useful before downloading a dataset because it allows <code>mlr3hf</code> to inspect repository properties such as storage size and modification time.</p>
<div class="cell">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_desc</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"scikit-learn/iris"</span>)</span></code></pre></div></div>
</div>
<p><strong>Example output</strong></p>
<pre class="text"><code>$id
[1] "scikit-learn/iris"

$author
[1] "scikit-learn"

$sha
[1] "0bda0ce801be0fa2f464ff845a9d5ceae99aad7d"

$lastModified
[1] "2022-06-20T14:17:01.000Z"

$usedStorage
[1] 5309549

...</code></pre>
<p>Internally, this metadata is used to make smarter download decisions. For example, the repository size can be used to prevent users from accidentally downloading extremely large datasets that may exceed their available storage.</p>
<p>The metadata retrieved by <code>download_desc()</code> will also be useful in higher-level classes such as <code>HFData</code>, where fields like <code>$lastModified</code> can be exposed through active bindings.</p>
</section>
<section id="current-progress" class="level2">
<h2 class="anchored" data-anchor-id="current-progress">Current Progress</h2>
<p>The following functionality has been implemented so far:</p>
<ul>
<li>Downloading datasets from the <code>refs/convert/parquet</code> branch.</li>
<li>Supporting dataset revisions through commit hashes.</li>
<li>Downloading canonical dataset files from the Hugging Face Hub.</li>
<li>Caching downloaded datasets locally.</li>
<li>Listing datasets available on Hugging Face.</li>
<li>Retrieving repository metadata for smarter download management.</li>
</ul>
</section>
<section id="future-work" class="level2">
<h2 class="anchored" data-anchor-id="future-work">Future Work</h2>
<p>The next major milestones for <code>mlr3hf</code> are:</p>
<ul>
<li>Implementing the <code>mlr3</code> backend for Hugging Face datasets.</li>
<li>Creating <code>mlr3</code> Tasks directly from the downloaded datasets.</li>
<li>Exposing richer dataset metadata, including the number of rows and columns.</li>
<li>Continuing to improve the caching and download infrastructure.</li>
</ul>
</section>
<section id="acknowledgements" class="level2">
<h2 class="anchored" data-anchor-id="acknowledgements">Acknowledgements</h2>
<p>I would like to thank my mentors, <strong>Toby Hocking</strong> and <strong>Sebastian Fischer</strong>, for their continuous guidance throughout the development of <code>mlr3hf</code>.</p>
<p>Many of the features described in this post began as rough or incomplete ideas. Before implementing them, I regularly discussed the design, API, and overall approach with my mentors. Their feedback helped me better understand the problem, refine the implementation, and make design decisions that aligned with the goals of the project.</p>
<p>I am grateful for their patience, insightful discussions, and constructive suggestions, which have been invaluable in shaping the package. Looking forward to work more with the mentor.</p>


</section>

 ]]></description>
  <category>gsoc</category>
  <category>mlr3hf</category>
  <category>caching</category>
  <category>symlink</category>
  <category>parquet</category>
  <guid>https://mlr3hf-blog.netlify.app/posts/post-6/</guid>
  <pubDate>Wed, 01 Jul 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>GSoC 2026 Update: Progress Through Week 5</title>
  <dc:creator>Anjani Nandan</dc:creator>
  <link>https://mlr3hf-blog.netlify.app/posts/post-5/</link>
  <description><![CDATA[ 





<section id="overview" class="level2">
<h2 class="anchored" data-anchor-id="overview">Overview</h2>
<p>I am currently in Week 5 of Google Summer of Code 2026, working on the <strong>mlr3hf</strong> project. The objective of this project is to make datasets hosted on Hugging Face Hub easily accessible within the mlr3 ecosystem.</p>
<p>Over the past five weeks, I have focused on building the core infrastructure required for dataset discovery, downloading, caching, and metadata management.</p>
</section>
<section id="completed-work" class="level2">
<h2 class="anchored" data-anchor-id="completed-work">Completed Work</h2>
<p>The following components have been implemented and are currently functional:</p>
<ul>
<li><code>cache_parquet.R</code></li>
<li><code>cache_hfhub.R</code></li>
<li><code>defaults.R</code></li>
<li><code>download_desc.R</code></li>
<li><code>list_datasets.R</code></li>
</ul>
<p>These functions provide the foundation for efficiently accessing and managing datasets from Hugging Face Hub.</p>
</section>
<section id="acknowledgements" class="level2">
<h2 class="anchored" data-anchor-id="acknowledgements">Acknowledgements</h2>
<p>I would like to thank Sebastian Fischer and Toby Hocking for their continuous support, guidance, and valuable feedback throughout the project.And I look forward to continuing this collaboration during the remainder of GSoC.</p>
</section>
<section id="hugging-face-inspired-caching-system" class="level2">
<h2 class="anchored" data-anchor-id="hugging-face-inspired-caching-system">Hugging Face Inspired Caching System</h2>
<p>One of the major milestones achieved so far is the implementation of a caching system inspired by the Hugging Face Hub architecture.</p>
<p>The cache follows a structure similar to Hugging Face’s caching mechanism:</p>
<ul>
<li><strong>Blobs</strong> store the actual file contents.</li>
<li><strong>Snapshots</strong> represent a specific dataset revision.</li>
<li><strong>Symlink</strong> connect snapshots and blob without duplicating data.</li>
</ul>
<p>This design allows multiple revisions of the same dataset to coexist locally while minimizing storage requirements.</p>
<p>Currently, users can:</p>
<ul>
<li>Download datasets directly from Hugging Face Hub.</li>
<li>Access datasets from specific revisions or commit hashes.</li>
<li>Work with public, gated, and private datasets (with appropriate authentication).</li>
<li>Reuse previously downloaded files through the cache, avoiding unnecessary downloads.</li>
</ul>
</section>
<section id="future-work-task-creation-and-data-backends" class="level2">
<h2 class="anchored" data-anchor-id="future-work-task-creation-and-data-backends">Future Work: Task Creation and Data Backends</h2>
<p>With the caching infrastructure in place, the next phase of development will focus on creating mlr3 tasks from downloaded datasets.</p>
<section id="parquet-datasets" class="level3">
<h3 class="anchored" data-anchor-id="parquet-datasets">Parquet Datasets</h3>
<p>For datasets available in Parquet format, I plan to explore integration with <strong>NanoParquet</strong>.</p>
<p>Hugging Face automatically converts uploaded datasets into Parquet format and stores them under the <code>refs/convert/parquet</code> branch. Leveraging these Parquet files should provide an efficient pathway for loading large datasets into mlr3.</p>
</section>
<section id="canonical-dataset-formats" class="level3">
<h3 class="anchored" data-anchor-id="canonical-dataset-formats">Canonical Dataset Formats</h3>
<p>In addition to Parquet support, canonical dataset also be supported via data.table:</p>
<ul>
<li>CSV</li>
<li>TSV</li>
<li>Other text formats</li>
</ul>
<p>For these datasets, I intend to use <code>DataBackendDataTable</code>, ensuring compatibility with existing mlr3 workflows.</p>
</section>
</section>
<section id="upcoming-milestones" class="level2">
<h2 class="anchored" data-anchor-id="upcoming-milestones">Upcoming Milestones</h2>
<p>The major goals for the coming weeks are:</p>
<ol type="1">
<li>Explore and integrate NanoParquet for Parquet-based datasets.</li>
<li>Implement task creation workflows.</li>
<li>Automatically select suitable backends based on dataset format.</li>
<li>Expand documentation and test coverage.</li>
<li>Improve interoperability with the broader mlr3 ecosystem.</li>
</ol>
</section>
<section id="conclusion" class="level2">
<h2 class="anchored" data-anchor-id="conclusion">Conclusion</h2>
<p>At this stage, the project has reached a stable foundation. The core dataset discovery, downloading, and caching infrastructure is now in place. The next phase will focus on transforming cached datasets into fully functional mlr3 tasks with efficient backend support.</p>
<p>I am excited to continue development and share further updates as the project progresses.</p>


</section>

 ]]></description>
  <category>gsoc</category>
  <category>mlr3hf</category>
  <category>caching</category>
  <category>symlink</category>
  <category>parquet</category>
  <guid>https://mlr3hf-blog.netlify.app/posts/post-5/</guid>
  <pubDate>Wed, 24 Jun 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Implementing caching and downloading</title>
  <dc:creator>Anjani Nandan</dc:creator>
  <link>https://mlr3hf-blog.netlify.app/posts/post-4/</link>
  <description><![CDATA[ 





<section id="implementing-cache.r-and-dataset-downloading" class="level2">
<h2 class="anchored" data-anchor-id="implementing-cache.r-and-dataset-downloading">Implementing <code>cache.R</code> and Dataset Downloading</h2>
<p>As we are currently in the first week of GSoC, I started implementing the caching and dataset downloading infrastructure for <strong>mlr3hf</strong>.</p>
<p>The cache system is designed to prevent unnecessary re-downloads while supporting different commits and revisions of a dataset. The implementation is inspired by the Hugging Face cache architecture described in their documentation. The main cache directory is <code>mlr3hf</code>, which stores downloaded datasets and metadata in a structured way.</p>
<p>For users who choose the parquet-based workflow, datasets are downloaded from the <code>refs/convert/parquet</code> branch.</p>
<section id="why-parquet" class="level3">
<h3 class="anchored" data-anchor-id="why-parquet">Why Parquet?</h3>
<p>One of the main reasons for choosing parquet is that it enables us to implement custom resampling strategies similar to those available in <code>mlr3oml</code>.</p>
<p>The parquet conversion branch contains datasets already organized into train, validation, and test splits, making it easier to create reproducible machine learning tasks and benchmarks.</p>
</section>
<section id="cache-architecture" class="level3">
<h3 class="anchored" data-anchor-id="cache-architecture">Cache Architecture</h3>
<p>To support dataset downloading and caching, I implemented <code>download_hfhub()</code> <code>cache.R</code> and <code>download_parquet()</code>.You can visit my <a href="https://github.com/anjaninandan001/mlr3hf">code</a>. This function downloads and manages files inside a <code>hub</code> directory located under the main <code>mlr3hf</code> cache folder.</p>
<p>The cache structure contains:</p>
<ul>
<li><code>blobs</code></li>
<li><code>snapshots</code></li>
<li><code>refs</code></li>
</ul>
<p>This design remains compatible across operating systems. Even when symbolic links are unavailable, files can still be downloaded and accessed correctly.</p>
<p>The implementation follows the general ideas used by Hugging Face Hub while adapting them to the needs of <code>mlr3hf</code>.</p>
</section>
<section id="comparison-with-pythons-load_dataset" class="level3">
<h3 class="anchored" data-anchor-id="comparison-with-pythons-load_dataset">Comparison with Python’s <code>load_dataset</code></h3>
<p>Downloading component of <code>mlr3hf</code> is conceptually similar to Python’s <code>load_dataset()</code>.</p>
<p>In the Python ecosystem:</p>
<ul>
<li>Datasets are cached in dedicated dataset and hub directories.</li>
<li>The Hub cache contains structures similar to <code>blobs</code>, <code>snapshots</code>, and <code>refs</code>.</li>
<li>Downloaded data is eventually converted into Arrow datasets and then accessed through libraries such as Pandas.</li>
</ul>
<p>In <code>mlr3hf</code>:</p>
<ul>
<li>We currently do not support Xet-based storage.</li>
<li>Parquet files are downloaded directly into the dataset cache.</li>
<li>This approach will integrate naturally with future DuckDB backends, allowing efficient querying and analysis without additional conversion steps.</li>
</ul>
</section>
<section id="acknowledgements" class="level3">
<h3 class="anchored" data-anchor-id="acknowledgements">Acknowledgements</h3>
<p>I would like to thank our mentors, Toby and Sebastian, for their guidance and design discussions.</p>
<p>I also took inspiration from:</p>
<ul>
<li>HF Hub a existing package of R <a href="https://github.com/mlverse/hfhub">hfhub</a></li>
<li>Hugging Face cache management <a href="https://huggingface.co/docs/huggingface_hub/guides/manage-cache">documentation</a></li>
</ul>
</section>
<section id="progress-so-far" class="level3">
<h3 class="anchored" data-anchor-id="progress-so-far">Progress So Far</h3>
<p>The following files have been implemented:</p>
<ul>
<li><code>download_hfhub.R</code></li>
<li><code>download_parquet.R</code></li>
<li><code>cache_paruet.R</code></li>
<li><code>cache_hfhub.R</code></li>
<li><code>defaults.R</code></li>
<li><code>utils.R</code></li>
</ul>
</section>
<section id="next-steps" class="level3">
<h3 class="anchored" data-anchor-id="next-steps">Next Steps</h3>
<p>The next stage of development will focus on implementing:</p>
<ul>
<li><code>HFData.R</code></li>
<li><code>HFObject.R</code></li>
</ul>
<p>along with their supporting components. These classes will form the core engineering layer of the package.</p>
</section>
<section id="feedback" class="level3">
<h3 class="anchored" data-anchor-id="feedback">Feedback</h3>
<p>If anyone have any questions, suggestions, or would like to discuss the design, feel free to contact me at:</p>
<p><strong><a href="mailto:anjaninandan599@gmail.com">anjaninandan599@gmail.com</a></strong></p>


</section>
</section>

 ]]></description>
  <category>symlink</category>
  <category>fs</category>
  <category>revsion</category>
  <category>parquet</category>
  <guid>https://mlr3hf-blog.netlify.app/posts/post-4/</guid>
  <pubDate>Fri, 29 May 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>finalising design for mlr3hf</title>
  <dc:creator>Anjani Nandan</dc:creator>
  <link>https://mlr3hf-blog.netlify.app/posts/post-3/</link>
  <description><![CDATA[ 





<section id="design-of-mlr3hf" class="level2">
<h2 class="anchored" data-anchor-id="design-of-mlr3hf">Design of <code>mlr3hf</code></h2>
<p>During the online meeting with our mentors,</p>
<p>Toby and Sebastian, we discussed several design-related questions and clarified important implementation details. One of the major goals of the community period is not only technical learning, but also maintaining continuous communication with mentors. Through these discussions and their guidance, I was able to finalise the package architecture and refine the overall design direction of the project. After the discussion, the design direction for <code>mlr3hf</code> became significantly clearer.</p>
<p>The proposed system will download datasets from Hugging Face and store them locally on disk. Once downloaded, data processing backends such as <code>data.table</code> or <code>DuckDB</code> will efficiently feed datasets into the <code>mlr3</code> ecosystem, where they will be converted into <code>Task</code> objects.</p>
<p>Although this workflow appears straightforward at first glance, building a robust and user-friendly implementation introduces several engineering challenges.</p>
</section>
<section id="cache-management-challenge" class="level2">
<h2 class="anchored" data-anchor-id="cache-management-challenge">Cache Management Challenge</h2>
<p>One of the major challenges is cache management.</p>
<p>Hugging Face datasets are associated with revisions such as commit hashes and branches, and users may want to download datasets from specific revisions rather than always using the latest version.</p>
<p>To address this, the current design explores Hugging Face’s storage structure involving:</p>
<ul>
<li>Snapshots</li>
<li>Blobs</li>
<li>Symbolic links (symlinks)</li>
</ul>
<p>This design aims to minimise duplication while improving storage efficiency.</p>
</section>
<section id="exploring-parquet-infrastructure" class="level2">
<h2 class="anchored" data-anchor-id="exploring-parquet-infrastructure">Exploring Parquet Infrastructure</h2>
<p>Another area of investigation is Hugging Face’s Parquet infrastructure.</p>
<p>Hugging Face automatically converts many datasets into Parquet format through its Parquet conversion pipeline. This simplifies dataset access because users do not need to explicitly provide filenames or revision details.</p>
<p>While this endpoint offers convenience, the long-term objective remains implementing dataset downloading directly through the Hugging Face API:</p>
<pre class="text"><code>https://huggingface.co/{repo_type}s/{repo_id}/resolve/{revision}/{filename}</code></pre>
<p>This approach provides finer revision control and aligns more closely with the design goals of <code>mlr3hf</code>.</p>
</section>
<section id="project-objectives" class="level2">
<h2 class="anchored" data-anchor-id="project-objectives">Project Objectives</h2>
<p>The overall objective is to build a system that balances:</p>
<ul>
<li>User friendliness</li>
<li>Efficient caching mechanisms</li>
<li>Revision-aware dataset management</li>
<li>Storage optimisation</li>
<li>Smooth integration with the <code>mlr3</code> workflow</li>
</ul>
<p>Building these capabilities in a clean and scalable manner makes the project significantly more challenging than it initially appears.</p>
</section>
<section id="agenda-for-the-upcoming-two-weeks" class="level2">
<h2 class="anchored" data-anchor-id="agenda-for-the-upcoming-two-weeks">Agenda for the Upcoming Two Weeks</h2>
<p><em>(25 May 2026 – 08 June 2026)</em></p>
<section id="planned-development-tasks" class="level3">
<h3 class="anchored" data-anchor-id="planned-development-tasks">Planned Development Tasks</h3>
<ul>
<li>Implement <code>cache.R</code></li>
<li>Implement <code>download_dataset.R</code></li>
<li>Develop and validate caching logic</li>
<li>Test dataset download functionality</li>
</ul>


</section>
</section>

 ]]></description>
  <category>data.table</category>
  <category>duckdb</category>
  <category>revsion</category>
  <category>parquet</category>
  <guid>https://mlr3hf-blog.netlify.app/posts/post-3/</guid>
  <pubDate>Fri, 22 May 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>talk with mentor</title>
  <dc:creator>Anjani Nandan</dc:creator>
  <link>https://mlr3hf-blog.netlify.app/posts/post-with-code/</link>
  <description><![CDATA[ 





<p>I learned how to use <strong>Quarto</strong> together with <strong>Netlify</strong> for building and deploying websites.</p>
<p>I followed the setup steps and guidance provided by my mentors regarding Quarto workflows and project organization. This helped me better understand how documentation and technical blogs can be maintained efficiently.</p>
<p>Alongside this, I have been exploring the codebase of <code>mlr3oml</code> to understand package structure and implementation details. I also learned about <strong>pkgdown</strong>, which is a useful tool for generating package documentation websites.</p>
<p>Going forward, I plan to integrate <code>pkgdown</code> into my package <strong><code>mlr3hf</code></strong> to improve documentation quality and make the package more accessible for users.</p>



 ]]></description>
  <category>netlify</category>
  <category>quarto</category>
  <category>pkgdown</category>
  <guid>https://mlr3hf-blog.netlify.app/posts/post-with-code/</guid>
  <pubDate>Tue, 12 May 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Welcome To My Blog</title>
  <dc:creator>Anjani Nadan</dc:creator>
  <link>https://mlr3hf-blog.netlify.app/posts/welcome/</link>
  <description><![CDATA[ 





<p>This is the first post in a Quarto blog. Welcome!</p>
<p><img src="https://mlr3hf-blog.netlify.app/posts/welcome/gsoc_selection.png" class="img-fluid"></p>
<p>I am very thankful to my mentors, Toby and Sebastian, for giving me the opportunity to contribute to the R project for statistical computing. As my mentors are my teachers, they inspire me to continuously improve my skills through their guidance and support. By the end of this journey, I hope to contribute a well-designed and optimized package to the project.</p>



 ]]></description>
  <category>gsoc</category>
  <guid>https://mlr3hf-blog.netlify.app/posts/welcome/</guid>
  <pubDate>Sat, 09 May 2026 00:00:00 GMT</pubDate>
</item>
</channel>
</rss>
