Skip to content

Latest commit

 

History

History
<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

    <title>data-science-book-uva &#8212; Data Science</title>
    
  <!-- Loaded before other Sphinx assets -->
  <link href="_static/styles/theme.css?digest=1999514e3f237ded88cf" rel="stylesheet">
<link href="_static/styles/pydata-sphinx-theme.css?digest=1999514e3f237ded88cf" rel="stylesheet">

    
  <link rel="stylesheet"
    href="_static/vendor/fontawesome/5.13.0/css/all.min.css">
  <link rel="preload" as="font" type="font/woff2" crossorigin
    href="_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff2">
  <link rel="preload" as="font" type="font/woff2" crossorigin
    href="_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2">

    <link rel="stylesheet" type="text/css" href="_static/pygments.css" />
    <link rel="stylesheet" href="_static/styles/sphinx-book-theme.css?digest=5115cc725059bd94278eecd172e13a965bf8f5a9" type="text/css" />
    <link rel="stylesheet" type="text/css" href="_static/togglebutton.css" />
    <link rel="stylesheet" type="text/css" href="_static/copybutton.css" />
    <link rel="stylesheet" type="text/css" href="_static/mystnb.css" />
    <link rel="stylesheet" type="text/css" href="_static/sphinx-thebe.css" />
    <link rel="stylesheet" type="text/css" href="_static/design-style.b7bb847fb20b106c3d81b95245e65545.min.css" />
    
  <!-- Pre-loaded scripts that we'll load fully later -->
  <link rel="preload" as="script" href="_static/scripts/pydata-sphinx-theme.js?digest=1999514e3f237ded88cf">

    <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
    <script src="_static/jquery.js"></script>
    <script src="_static/underscore.js"></script>
    <script src="_static/doctools.js"></script>
    <script src="_static/clipboard.min.js"></script>
    <script src="_static/copybutton.js"></script>
    <script src="_static/scripts/sphinx-book-theme.js?digest=9c920249402e914e316237a7dbc6769907cce411"></script>
    <script>let toggleHintShow = 'Click to show';</script>
    <script>let toggleHintHide = 'Click to hide';</script>
    <script>let toggleOpenOnPrint = 'true';</script>
    <script src="_static/togglebutton.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
    <script>var togglebuttonSelector = '.toggle, .admonition.dropdown, .tag_hide_input div.cell_input, .tag_hide-input div.cell_input, .tag_hide_output div.cell_output, .tag_hide-output div.cell_output, .tag_hide_cell.cell, .tag_hide-cell.cell';</script>
    <script src="_static/design-tabs.js"></script>
    <script>const THEBE_JS_URL = "https://unpkg.com/[email protected]/lib/index.js"
const thebe_selector = ".thebe,.cell"
const thebe_selector_input = "pre"
const thebe_selector_output = ".output, .cell_output"
</script>
    <script async="async" src="_static/sphinx-thebe.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="docsearch:language" content="None">
    

    <!-- Google Analytics -->
    
  </head>
  <body data-spy="scroll" data-target="#bd-toc-nav" data-offset="60">
<!-- Checkboxes to toggle the left sidebar -->
<input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation" aria-label="Toggle navigation sidebar">
<label class="overlay overlay-navbar" for="__navigation">
    <div class="visually-hidden">Toggle navigation sidebar</div>
</label>
<!-- Checkboxes to toggle the in-page toc -->
<input type="checkbox" class="sidebar-toggle" name="__page-toc" id="__page-toc" aria-label="Toggle in-page Table of Contents">
<label class="overlay overlay-pagetoc" for="__page-toc">
    <div class="visually-hidden">Toggle in-page Table of Contents</div>
</label>
<!-- Headers at the top -->
<div class="announcement header-item noprint"></div>
<div class="header header-item noprint"></div>

    
    <div class="container-fluid" id="banner"></div>

    

    <div class="container-xl">
      <div class="row">
          
<!-- Sidebar -->
<div class="bd-sidebar noprint" id="site-navigation">
    <div class="bd-sidebar__content">
        <div class="bd-sidebar__top"><div class="navbar-brand-box">
    <a class="navbar-brand text-wrap" href="index.html">
      
        <!-- `logo` is deprecated in Sphinx 4.0, so remove this when we stop supporting 3 -->
        
      
      
      <img src="_static/uvalogo.png" class="logo" alt="logo">
      
      
      <h1 class="site-logo" id="site-title">Data Science</h1>
      
    </a>
</div><form class="bd-search d-flex align-items-center" action="search.html" method="get">
  <i class="icon fas fa-search"></i>
  <input type="search" class="form-control" name="q" id="search-input" placeholder="Search this book..." aria-label="Search this book..." autocomplete="off" >
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main">
    <div class="bd-toc-item active">
        
        <ul class="nav bd-sidenav bd-sidenav__home-link">
            <li class="toctree-l1">
                <a class="reference internal" href="docs/home.html">
                    Course Overview
                </a>
            </li>
        </ul>
        <ul class="nav bd-sidenav">
 <li class="toctree-l1">
  <a class="reference internal" href="docs/syllabus.html">
   Course Syllabus
  </a>
 </li>
 <li class="toctree-l1">
  <a class="reference internal" href="docs/resources.html">
   Course Resources
  </a>
 </li>
</ul>
<p aria-level="2" class="caption" role="heading">
 <span class="caption-text">
  Lectures
 </span>
</p>
<ul class="nav bd-sidenav">
 <li class="toctree-l1">
  <a class="reference internal" href="docs/lectures/lec1.html">
   L1: Introduction
  </a>
 </li>
 <li class="toctree-l1">
  <a class="reference internal" href="docs/lectures/lec2.html">
   L2: Data Science Fundamentals
  </a>
 </li>
 <li class="toctree-l1">
  <a class="reference internal" href="docs/lectures/lec3.html">
   L3: Structured Data I
  </a>
 </li>
 <li class="toctree-l1">
  <a class="reference internal" href="docs/lectures/lec4.html">
   L4: Structured Data II
  </a>
 </li>
 <li class="toctree-l1">
  <a class="reference internal" href="docs/lectures/lec5.html">
   L5: Deep Learning Overview
  </a>
 </li>
 <li class="toctree-l1">
  <a class="reference internal" href="docs/lectures/lec6.html">
   L6: Crowdsourcing
  </a>
 </li>
 <li class="toctree-l1">
  <a class="reference internal" href="docs/lectures/lec7.html">
   L7: Text Data I
  </a>
 </li>
 <li class="toctree-l1">
  <a class="reference internal" href="docs/lectures/lec8.html">
   L8: Text Data II
  </a>
 </li>
 <li class="toctree-l1">
  <a class="reference internal" href="docs/lectures/lec9.html">
   L9: PyTorch Basics
  </a>
 </li>
 <li class="toctree-l1">
  <a class="reference internal" href="docs/lectures/lec10.html">
   L10: Image Data I
  </a>
 </li>
 <li class="toctree-l1">
  <a class="reference internal" href="docs/lectures/lec11.html">
   L11: Image Data II
  </a>
 </li>
 <li class="toctree-l1">
  <a class="reference internal" href="docs/lectures/lec12.html">
   L12: Human-Centered Method
  </a>
 </li>
</ul>
<p aria-level="2" class="caption" role="heading">
 <span class="caption-text">
  Modules
 </span>
</p>
<ul class="nav bd-sidenav">
 <li class="toctree-l1 has-children">
  <a class="reference internal" href="docs/modules/structured-data-module/overview-structured-data.html">
   Structured Data
  </a>
  <input class="toctree-checkbox" id="toctree-checkbox-1" name="toctree-checkbox-1" type="checkbox"/>
  <label for="toctree-checkbox-1">
   <i class="fas fa-chevron-down">
   </i>
  </label>
  <ul>
   <li class="toctree-l2">
    <a class="reference internal" href="docs/modules/structured-data-module/preparation-structured-data.html">
     Preparation
    </a>
   </li>
   <li class="toctree-l2">
    <a class="reference internal" href="docs/modules/structured-data-module/tutorial-structured-data.html">
     Tutorial
    </a>
   </li>
  </ul>
 </li>
 <li class="toctree-l1 has-children">
  <a class="reference internal" href="docs/modules/text-data-module/overview-text-data.html">
   Text Data
  </a>
  <input class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" type="checkbox"/>
  <label for="toctree-checkbox-2">
   <i class="fas fa-chevron-down">
   </i>
  </label>
  <ul>
   <li class="toctree-l2">
    <a class="reference internal" href="docs/modules/text-data-module/preparation-text-data.html">
     Preparation
    </a>
   </li>
   <li class="toctree-l2">
    <a class="reference internal" href="docs/modules/text-data-module/tutorial-text-data.html">
     Tutorial
    </a>
   </li>
  </ul>
 </li>
 <li class="toctree-l1 has-children">
  <a class="reference internal" href="docs/modules/image-data-module/overview-image-data.html">
   Image Data
  </a>
  <input class="toctree-checkbox" id="toctree-checkbox-3" name="toctree-checkbox-3" type="checkbox"/>
  <label for="toctree-checkbox-3">
   <i class="fas fa-chevron-down">
   </i>
  </label>
  <ul>
   <li class="toctree-l2">
    <a class="reference internal" href="docs/modules/image-data-module/preparation-image-data.html">
     Preparation
    </a>
   </li>
   <li class="toctree-l2">
    <a class="reference internal" href="docs/modules/image-data-module/tutorial-image-data-notebook.html">
     Tutorial
    </a>
   </li>
  </ul>
 </li>
</ul>
<p aria-level="2" class="caption" role="heading">
 <span class="caption-text">
  Assignments
 </span>
</p>
<ul class="nav bd-sidenav">
 <li class="toctree-l1">
  <a class="reference internal" href="docs/assignments/hw1.html">
   A1: Python Coding Warm-Up
  </a>
 </li>
 <li class="toctree-l1">
  <a class="reference internal" href="docs/modules/structured-data-module/assignment-structured-data.html">
   A2: Structured Data
  </a>
 </li>
 <li class="toctree-l1">
  <a class="reference internal" href="docs/assignments/hw3.html">
   A3: Mock Exam
  </a>
 </li>
 <li class="toctree-l1">
  <a class="reference internal" href="docs/modules/text-data-module/assignment-text-data.html">
   A4: Text Data
  </a>
 </li>
 <li class="toctree-l1">
  <a class="reference internal" href="docs/assignments/hw5.html">
   A5: PyTorch Basics
  </a>
 </li>
 <li class="toctree-l1">
  <a class="reference internal" href="docs/modules/image-data-module/assignment-image-data.html">
   A6: Image Data
  </a>
 </li>
</ul>

    </div>
</nav></div>
        <div class="bd-sidebar__bottom">
             <!-- To handle the deprecated key -->
            
            <div class="navbar_extra_footer">
            Powered by <a href="https://jupyterbook.org">Jupyter Book</a>
            </div>
            
        </div>
    </div>
    <div id="rtd-footer-container"></div>
</div>


          


          
<!-- A tiny helper pixel to detect if we've scrolled -->
<div class="sbt-scroll-pixel-helper"></div>
<!-- Main content -->
<div class="col py-0 content-container">
    
    <div class="header-article row sticky-top noprint">
        



<div class="col py-1 d-flex header-article-main">
    <div class="header-article__left">
        
        <label for="__navigation"
  class="headerbtn"
  data-toggle="tooltip"
data-placement="right"
title="Toggle navigation"
>
  

<span class="headerbtn__icon-container">
  <i class="fas fa-bars"></i>
  </span>

</label>

        
    </div>
    <div class="header-article__right">
<button onclick="toggleFullScreen()"
  class="headerbtn"
  data-toggle="tooltip"
data-placement="bottom"
title="Fullscreen mode"
>
  

<span class="headerbtn__icon-container">
  <i class="fas fa-expand"></i>
  </span>

</button>

<div class="menu-dropdown menu-dropdown-repository-buttons">
  <button class="headerbtn menu-dropdown__trigger"
      aria-label="Source repositories">
      <i class="fab fa-github"></i>
  </button>
  <div class="menu-dropdown__content">
    <ul>
      <li>
        <a href="https://github.com/MultiX-Amsterdam/data-science-book-uva"
   class="headerbtn"
   data-toggle="tooltip"
data-placement="left"
title="Source repository"
>
  

<span class="headerbtn__icon-container">
  <i class="fab fa-github"></i>
  </span>
<span class="headerbtn__text-container">repository</span>
</a>

      </li>
      
      <li>
        <a href="https://github.com/MultiX-Amsterdam/data-science-book-uva/issues/new?title=Issue%20on%20page%20%2FREADME.html&body=Your%20issue%20content%20here."
   class="headerbtn"
   data-toggle="tooltip"
data-placement="left"
title="Open an issue"
>
  

<span class="headerbtn__icon-container">
  <i class="fas fa-lightbulb"></i>
  </span>
<span class="headerbtn__text-container">open issue</span>
</a>

      </li>
      
    </ul>
  </div>
</div>

<div class="menu-dropdown menu-dropdown-download-buttons">
  <button class="headerbtn menu-dropdown__trigger"
      aria-label="Download this page">
      <i class="fas fa-download"></i>
  </button>
  <div class="menu-dropdown__content">
    <ul>
      <li>
        <a href="_sources/README.md"
   class="headerbtn"
   data-toggle="tooltip"
data-placement="left"
title="Download source file"
>
  

<span class="headerbtn__icon-container">
  <i class="fas fa-file"></i>
  </span>
<span class="headerbtn__text-container">.md</span>
</a>

      </li>
      
      <li>
        
<button onclick="printPdf(this)"
  class="headerbtn"
  data-toggle="tooltip"
data-placement="left"
title="Print to PDF"
>
  

<span class="headerbtn__icon-container">
  <i class="fas fa-file-pdf"></i>
  </span>
<span class="headerbtn__text-container">.pdf</span>
</button>

      </li>
      
    </ul>
  </div>
</div>
<label for="__page-toc"
  class="headerbtn headerbtn-page-toc"
  
>
  

<span class="headerbtn__icon-container">
  <i class="fas fa-list"></i>
  </span>

</label>

    </div>
</div>

<!-- Table of contents -->
<div class="col-md-3 bd-toc show noprint">
    <div class="tocsection onthispage pt-5 pb-3">
        <i class="fas fa-list"></i> Contents
    </div>
    <nav id="bd-toc-nav" aria-label="Page">
        <ul class="visible nav section-nav flex-column">
 <li class="toc-h2 nav-item toc-entry">
  <a class="reference internal nav-link" href="#error-handling">
   Error Handling
  </a>
 </li>
</ul>

    </nav>
</div>
    </div>
    <div class="article row">
        <div class="col pl-md-3 pl-lg-5 content-container">
            <!-- Table of contents that is only displayed when printing the page -->
            <div id="jb-print-docs-body" class="onlyprint">
                <h1>data-science-book-uva</h1>
                <!-- Table of contents -->
                <div id="print-main-content">
                    <div id="jb-print-toc">
                        
                        <div>
                            <h2> Contents </h2>
                        </div>
                        <nav aria-label="Page">
                            <ul class="visible nav section-nav flex-column">
 <li class="toc-h2 nav-item toc-entry">
  <a class="reference internal nav-link" href="#error-handling">
   Error Handling
  </a>
 </li>
</ul>

                        </nav>
                    </div>
                </div>
            </div>
            <main id="main-content" role="main">
                
              <div>
                
  <section class="tex2jax_ignore mathjax_ignore" id="data-science-book-uva">
<h1>data-science-book-uva<a class="headerlink" href="#data-science-book-uva" title="Permalink to this headline">#</a></h1>
<p>This repository hosts the website for the data science course (Bachelor level) at the Informatics Institute, University of Amsterdam. The webite is built using <a class="reference external" href="https://jupyterbook.org/en/stable/intro.html">Jupyter Book</a>.</p>
<p>All the course content in this repository is licensed under a <a class="reference external" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.</p>
<p>Below are the steps to update and build this book. First, clone this repository to your local machine. Assume that you already have <a class="reference external" href="https://docs.conda.io/en/main/miniconda.html">miniconda</a> installed. Next, install the jupyter-book package:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>$ conda create -n jupyterbook
$ conda activate jupyterbook
$ conda install python
$ pip install -U jupyter-book
$ pip install ghp-import
$ jupyter-book --help
</pre></div>
</div>
<p>Then, clone this repository and build the book:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>$ git clone https://github.com/MultiX-Amsterdam/data-science-book-uva
$ <span class="nb">cd</span> data-science-book-uva
$ jupyter-book build .
</pre></div>
</div>
<p>To rebuild the entire book, use the following:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>$ jupyter-book build --all .
</pre></div>
</div>
<p>Once it is done, you can view the book in the <span class="xref myst">html content</span> folder using a web browser. To update the book online in this GitHub repository (in the gh-pages branch), run the following:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>$ ghp-import -n -p -f _build/html
</pre></div>
</div>
<p>The above steps will update the gh-pages branch, which hosts the website. Finally, follow the normal git flow to commit the changes and push the code to the main branch in this repository.</p>
<section id="error-handling">
<h2>Error Handling<a class="headerlink" href="#error-handling" title="Permalink to this headline">#</a></h2>
<p>You many encounter an error that looks like the following when building the notebook:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>Extension error <span class="o">(</span>sphinx_external_toc.events<span class="o">)</span>:
Handler &lt;<span class="k">function</span> add_changed_toctrees at 0x10a031750&gt; <span class="k">for</span> event <span class="s1">&#39;env-get-outdated&#39;</span> threw an exception <span class="o">(</span>exception: <span class="s1">&#39;Document&#39;</span> object has no attribute <span class="s1">&#39;docname&#39;</span><span class="o">)</span>
Traceback <span class="o">(</span>most recent call last<span class="o">)</span>:
  File <span class="s2">&quot;/opt/homebrew/Caskroom/miniconda/base/envs/jupyterbook/lib/python3.10/site-packages/sphinx/events.py&quot;</span>, line <span class="m">94</span>, <span class="k">in</span> emit
    results.append<span class="o">(</span>listener.handler<span class="o">(</span>self.app, *args<span class="o">))</span>
  File <span class="s2">&quot;/opt/homebrew/Caskroom/miniconda/base/envs/jupyterbook/lib/python3.10/site-packages/sphinx_external_toc/events.py&quot;</span>, line <span class="m">138</span>, <span class="k">in</span> add_changed_toctrees
    <span class="nv">filenames</span> <span class="o">=</span> site_map.get_changed<span class="o">(</span>previous_map<span class="o">)</span>
  File <span class="s2">&quot;/opt/homebrew/Caskroom/miniconda/base/envs/jupyterbook/lib/python3.10/site-packages/sphinx_external_toc/api.py&quot;</span>, line <span class="m">220</span>, <span class="k">in</span> get_changed
    <span class="k">if</span> self.root.docname !<span class="o">=</span> previous.root.docname:
AttributeError: <span class="s1">&#39;Document&#39;</span> object has no attribute <span class="s1">&#39;docname&#39;</span>
</pre></div>
</div>
<p>In this case, just run the following command, and the problem should disappear:</p>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>pip install jupyter-cache
</pre></div>
</div>
</section>
</section>

    <script type="text/x-thebe-config">
    {
        requestKernel: true,
        binderOptions: {
            repo: "binder-examples/jupyter-stacks-datascience",
            ref: "master",
        },
        codeMirrorConfig: {
            theme: "abcdef",
            mode: "python"
        },
        kernelOptions: {
            kernelName: "python3",
            path: "./."
        },
        predefinedOutput: true
    }
    </script>
    <script>kernelName = 'python3'</script>

              </div>
              
            </main>
            <footer class="footer-article noprint">
                
    <!-- Previous / next buttons -->
<div class='prev-next-area'>
</div>
            </footer>
        </div>
    </div>
    <div class="footer-content row">
        <footer class="col footer"><p>
  
    By Yen-Chia Hsu<br/>
  
      &copy; Copyright 2022.<br/>
</p>
        </footer>
    </div>
    
</div>


      </div>
    </div>
  
  <!-- Scripts loaded after <body> so the DOM is not blocked -->
  <script src="_static/scripts/pydata-sphinx-theme.js?digest=1999514e3f237ded88cf"></script>


  </body>
</html>