Skip to content

Commit

Permalink
deploy: 7e7630e
Browse files Browse the repository at this point in the history
  • Loading branch information
baniasbaabe committed Dec 4, 2023
1 parent dd83340 commit d757b88
Show file tree
Hide file tree
Showing 5 changed files with 177 additions and 1 deletion.
54 changes: 54 additions & 0 deletions _sources/book/cooltools/Chapter.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1611,6 +1611,60 @@
"\n",
"print(config[\"DOMAIN\"])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Work with Notion via Python with"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Did you know you can interact with Notion via Python?\n",
"\n",
"`notion-client` is a Python SDK for working with the Notion API.\n",
"\n",
"You can create databases, search for items, interact with pages, etc.\n",
"\n",
"Check the example below."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!pip install notion-client"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from notion_client import Client\n",
"\n",
"notion = Client(\"<NOTION_TOKEN>\")\n",
"\n",
"print(notion.users.list())\n",
"\n",
"my_page = notion.databases.query(\n",
" **{\n",
" \"database_id\": \"897e5a76-ae52-4b48-9fdf-e71f5945d1af\",\n",
" \"filter\": {\n",
" \"property\": \"Landmark\",\n",
" \"rich_text\": {\n",
" \"contains\": \"Bridge\",\n",
" },\n",
" },\n",
" }\n",
" )"
]
}
],
"metadata": {
Expand Down
49 changes: 49 additions & 0 deletions _sources/book/machinelearning/timeseries.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,55 @@
"mlf.fit(df)\n",
"mlf.predict(12)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Lightning Fast Time Series Forecasting with `statsforecast`"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Do you want to perform lightning fast time series forecasting?\n",
"\n",
"Try `statsforecast` by Nixtla.\n",
"\n",
"`statsforecast` lets you run statistical models on your time series data.\n",
"\n",
"It’s up to 20x faster than existing libraries like pmdarima and statsmodels."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!pip install statsforecast"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from statsforecast import StatsForecast\n",
"from statsforecast.models import AutoARIMA\n",
"from statsforecast.utils import AirPassengersDF\n",
"\n",
"df = AirPassengersDF\n",
"sf = StatsForecast(\n",
" models = [AutoARIMA(season_length = 12)],\n",
" freq = 'M'\n",
")\n",
"\n",
"sf.fit(df)\n",
"sf.predict(h=12, level=[95])"
]
}
],
"metadata": {
Expand Down
39 changes: 39 additions & 0 deletions book/cooltools/Chapter.html
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ <h2> Contents </h2>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#calculate-code-metrics-with-radon">2.1.31. Calculate Code Metrics with <code class="docutils literal notranslate"><span class="pre">radon</span></code></a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#better-alternative-to-requests">2.1.32. Better Alternative to <code class="docutils literal notranslate"><span class="pre">requests</span></code></a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#managing-configurations-with-python-dotenv">2.1.33. Managing Configurations with <code class="docutils literal notranslate"><span class="pre">python-dotenv</span></code></a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#work-with-notion-via-python-with">2.1.34. Work with Notion via Python with</a></li>
</ul>
</nav>
</div>
Expand Down Expand Up @@ -1416,6 +1417,43 @@ <h2><span class="section-number">2.1.33. </span>Managing Configurations with <co
</div>
</div>
</section>
<section id="work-with-notion-via-python-with">
<h2><span class="section-number">2.1.34. </span>Work with Notion via Python with<a class="headerlink" href="#work-with-notion-via-python-with" title="Permalink to this heading">#</a></h2>
<p>Did you know you can interact with Notion via Python?</p>
<p><code class="docutils literal notranslate"><span class="pre">notion-client</span></code> is a Python SDK for working with the Notion API.</p>
<p>You can create databases, search for items, interact with pages, etc.</p>
<p>Check the example below.</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span>!pip install notion-client
</pre></div>
</div>
</div>
</div>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">notion_client</span> <span class="kn">import</span> <span class="n">Client</span>

<span class="n">notion</span> <span class="o">=</span> <span class="n">Client</span><span class="p">(</span><span class="s2">&quot;&lt;NOTION_TOKEN&gt;&quot;</span><span class="p">)</span>

<span class="nb">print</span><span class="p">(</span><span class="n">notion</span><span class="o">.</span><span class="n">users</span><span class="o">.</span><span class="n">list</span><span class="p">())</span>

<span class="n">my_page</span> <span class="o">=</span> <span class="n">notion</span><span class="o">.</span><span class="n">databases</span><span class="o">.</span><span class="n">query</span><span class="p">(</span>
<span class="o">**</span><span class="p">{</span>
<span class="s2">&quot;database_id&quot;</span><span class="p">:</span> <span class="s2">&quot;897e5a76-ae52-4b48-9fdf-e71f5945d1af&quot;</span><span class="p">,</span>
<span class="s2">&quot;filter&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;property&quot;</span><span class="p">:</span> <span class="s2">&quot;Landmark&quot;</span><span class="p">,</span>
<span class="s2">&quot;rich_text&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;contains&quot;</span><span class="p">:</span> <span class="s2">&quot;Bridge&quot;</span><span class="p">,</span>
<span class="p">},</span>
<span class="p">},</span>
<span class="p">}</span>
<span class="p">)</span>
</pre></div>
</div>
</div>
</div>
</section>
</section>

<script type="text/x-thebe-config">
Expand Down Expand Up @@ -1518,6 +1556,7 @@ <h2><span class="section-number">2.1.33. </span>Managing Configurations with <co
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#calculate-code-metrics-with-radon">2.1.31. Calculate Code Metrics with <code class="docutils literal notranslate"><span class="pre">radon</span></code></a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#better-alternative-to-requests">2.1.32. Better Alternative to <code class="docutils literal notranslate"><span class="pre">requests</span></code></a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#managing-configurations-with-python-dotenv">2.1.33. Managing Configurations with <code class="docutils literal notranslate"><span class="pre">python-dotenv</span></code></a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#work-with-notion-via-python-with">2.1.34. Work with Notion via Python with</a></li>
</ul>
</nav></div>

Expand Down
34 changes: 34 additions & 0 deletions book/machinelearning/timeseries.html
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ <h2> Contents </h2>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#cross-validation-for-time-series-data-with-timeseriessplit">5.7.2. Cross-validation for Time Series Data with <code class="docutils literal notranslate"><span class="pre">TimeSeriesSplit</span></code></a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#more-cross-validation-with-tscv">5.7.3. More Cross-Validation with <code class="docutils literal notranslate"><span class="pre">tscv</span></code></a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#time-series-forecasting-with-machine-learning-with-mlforecast">5.7.4. Time Series Forecasting with Machine Learning with <code class="docutils literal notranslate"><span class="pre">mlforecast</span></code></a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#lightning-fast-time-series-forecasting-with-statsforecast">5.7.5. Lightning Fast Time Series Forecasting with <code class="docutils literal notranslate"><span class="pre">statsforecast</span></code></a></li>
</ul>
</nav>
</div>
Expand Down Expand Up @@ -543,6 +544,38 @@ <h2><span class="section-number">5.7.4. </span>Time Series Forecasting with Mach
</div>
</div>
</section>
<section id="lightning-fast-time-series-forecasting-with-statsforecast">
<h2><span class="section-number">5.7.5. </span>Lightning Fast Time Series Forecasting with <code class="docutils literal notranslate"><span class="pre">statsforecast</span></code><a class="headerlink" href="#lightning-fast-time-series-forecasting-with-statsforecast" title="Permalink to this heading">#</a></h2>
<p>Do you want to perform lightning fast time series forecasting?</p>
<p>Try <code class="docutils literal notranslate"><span class="pre">statsforecast</span></code> by Nixtla.</p>
<p><code class="docutils literal notranslate"><span class="pre">statsforecast</span></code> lets you run statistical models on your time series data.</p>
<p>It’s up to 20x faster than existing libraries like pmdarima and statsmodels.</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span>!pip install statsforecast
</pre></div>
</div>
</div>
</div>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">statsforecast</span> <span class="kn">import</span> <span class="n">StatsForecast</span>
<span class="kn">from</span> <span class="nn">statsforecast.models</span> <span class="kn">import</span> <span class="n">AutoARIMA</span>
<span class="kn">from</span> <span class="nn">statsforecast.utils</span> <span class="kn">import</span> <span class="n">AirPassengersDF</span>

<span class="n">df</span> <span class="o">=</span> <span class="n">AirPassengersDF</span>
<span class="n">sf</span> <span class="o">=</span> <span class="n">StatsForecast</span><span class="p">(</span>
<span class="n">models</span> <span class="o">=</span> <span class="p">[</span><span class="n">AutoARIMA</span><span class="p">(</span><span class="n">season_length</span> <span class="o">=</span> <span class="mi">12</span><span class="p">)],</span>
<span class="n">freq</span> <span class="o">=</span> <span class="s1">&#39;M&#39;</span>
<span class="p">)</span>

<span class="n">sf</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="n">df</span><span class="p">)</span>
<span class="n">sf</span><span class="o">.</span><span class="n">predict</span><span class="p">(</span><span class="n">h</span><span class="o">=</span><span class="mi">12</span><span class="p">,</span> <span class="n">level</span><span class="o">=</span><span class="p">[</span><span class="mi">95</span><span class="p">])</span>
</pre></div>
</div>
</div>
</div>
</section>
</section>

<script type="text/x-thebe-config">
Expand Down Expand Up @@ -616,6 +649,7 @@ <h2><span class="section-number">5.7.4. </span>Time Series Forecasting with Mach
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#cross-validation-for-time-series-data-with-timeseriessplit">5.7.2. Cross-validation for Time Series Data with <code class="docutils literal notranslate"><span class="pre">TimeSeriesSplit</span></code></a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#more-cross-validation-with-tscv">5.7.3. More Cross-Validation with <code class="docutils literal notranslate"><span class="pre">tscv</span></code></a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#time-series-forecasting-with-machine-learning-with-mlforecast">5.7.4. Time Series Forecasting with Machine Learning with <code class="docutils literal notranslate"><span class="pre">mlforecast</span></code></a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#lightning-fast-time-series-forecasting-with-statsforecast">5.7.5. Lightning Fast Time Series Forecasting with <code class="docutils literal notranslate"><span class="pre">statsforecast</span></code></a></li>
</ul>
</nav></div>

Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit d757b88

Please sign in to comment.