---

title: Diginetica dataset


keywords: fastai
sidebar: home_sidebar

summary: "Diginetica dataset."
description: "Diginetica dataset."
nb_path: "nbs/datasets/diginetica.ipynb"
---
<!--

#################################################
### THIS FILE WAS AUTOGENERATED! DO NOT EDIT! ###
#################################################
# file to edit: nbs/datasets/diginetica.ipynb
# command to build the docs after a change: nbdev_build_docs

-->

<div class="container" id="notebook-container">
        
    {% raw %}
    
<div class="cell border-box-sizing code_cell rendered">

</div>
    {% endraw %}

    {% raw %}
    
<div class="cell border-box-sizing code_cell rendered">

</div>
    {% endraw %}

    {% raw %}
    
<div class="cell border-box-sizing code_cell rendered">

<div class="output_wrapper">
<div class="output">

<div class="output_area">


<div class="output_markdown rendered_html output_subarea ">
<h2 id="DigineticaDataset" class="doc_header"><code>class</code> <code>DigineticaDataset</code><a href="https://github.com/RecoHut-Projects/recohut/tree/master/recohut/datasets/diginetica.py#L12" class="source_link" style="float:right">[source]</a></h2><blockquote><p><code>DigineticaDataset</code>(<strong><code>root</code></strong>, <strong><code>column_names</code></strong>=<em><code>{'SESSION_ID': 'sessionId', 'ITEM_ID': 'itemId', 'TIMEFRAME': 'timeframe', 'EVENT_DATE': 'eventdate'}</code></em>) :: <a href="/recohut/base.html#SessionDatasetv2"><code>SessionDatasetv2</code></a></p>
</blockquote>
<p>Dataset base class</p>

</div>

</div>

</div>
</div>

</div>
    {% endraw %}

    {% raw %}
    
<div class="cell border-box-sizing code_cell rendered">

</div>
    {% endraw %}

    {% raw %}
    
<div class="cell border-box-sizing code_cell rendered">
<div class="input">

<div class="inner_cell">
    <div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">ds</span> <span class="o">=</span> <span class="n">DigineticaDataset</span><span class="p">(</span><span class="n">root</span><span class="o">=</span><span class="s1">&#39;/content/digidata&#39;</span><span class="p">)</span>
</pre></div>

    </div>
</div>
</div>

<div class="output_wrapper">
<div class="output">

<div class="output_area">

<div class="output_subarea output_stream output_stderr output_text">
<pre>Downloading https://github.com/RecoHut-Datasets/diginetica/raw/main/train-item-views.csv
Processing...
</pre>
</div>
</div>

<div class="output_area">

<div class="output_subarea output_stream output_stdout output_text">
<pre>-- Reading data
Splitting date 1464134400.0
186670
15979
[(&#39;4737&#39;, 1451606400.0), (&#39;4741&#39;, 1451606400.0), (&#39;4742&#39;, 1451606400.0)]
[(&#39;289&#39;, 1464220800.0), (&#39;290&#39;, 1464220800.0), (&#39;302&#39;, 1464220800.0)]
-- Splitting train set and test set
43098
719470
60858
[[1], [3, 4], [3]] [1451606400.0, 1451606400.0, 1451606400.0] [2, 5, 4]
[[21553, 20071, 8762, 21566, 6381], [21553, 20071, 8762, 21566], [21553, 20071, 8762]] [1464220800.0, 1464220800.0, 1464220800.0] [21566, 6381, 21566]
avg length:  4.850942344040704
</pre>
</div>
</div>

<div class="output_area">

<div class="output_subarea output_stream output_stderr output_text">
<pre>Done!
</pre>
</div>
</div>

</div>
</div>

</div>
    {% endraw %}

    {% raw %}
    
<div class="cell border-box-sizing code_cell rendered">

<div class="output_wrapper">
<div class="output">

<div class="output_area">


<div class="output_markdown rendered_html output_subarea ">
<h2 id="DigineticaDatasetv2" class="doc_header"><code>class</code> <code>DigineticaDatasetv2</code><a href="https://github.com/RecoHut-Projects/recohut/tree/master/recohut/datasets/diginetica.py#L29" class="source_link" style="float:right">[source]</a></h2><blockquote><p><code>DigineticaDatasetv2</code>(<strong><code>root</code></strong>, <strong><code>shuffle</code></strong>=<em><code>False</code></em>, <strong><code>n_node</code></strong>=<em><code>43097</code></em>, <strong><code>is_train</code></strong>=<em><code>True</code></em>) :: <a href="/recohut/base.html#SessionGraphDataset"><code>SessionGraphDataset</code></a></p>
</blockquote>
<p>References</p>

<pre><code>1. COTREC session-based recommender model training. https://t.ly/cXTH.</code></pre>

</div>

</div>

</div>
</div>

</div>
    {% endraw %}

    {% raw %}
    
<div class="cell border-box-sizing code_cell rendered">

</div>
    {% endraw %}

    {% raw %}
    
<div class="cell border-box-sizing code_cell rendered">
<div class="input">

<div class="inner_cell">
    <div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="n">root</span> <span class="o">=</span> <span class="s1">&#39;/content/diginetica&#39;</span>

<span class="n">train_data</span> <span class="o">=</span> <span class="n">DigineticaDataset</span><span class="p">(</span><span class="n">root</span><span class="o">=</span><span class="n">root</span><span class="p">,</span> <span class="n">shuffle</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">is_train</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="n">test_data</span> <span class="o">=</span> <span class="n">DigineticaDataset</span><span class="p">(</span><span class="n">root</span><span class="o">=</span><span class="n">root</span><span class="p">,</span> <span class="n">shuffle</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">is_train</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
</pre></div>

    </div>
</div>
</div>

</div>
    {% endraw %}

</div>
 

