Skip to content

Commit

Permalink
fixed quickstart
Browse files Browse the repository at this point in the history
  • Loading branch information
BalzaniEdoardo committed Nov 15, 2024
1 parent 3ba0d4e commit c43c6f9
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 12 deletions.
16 changes: 16 additions & 0 deletions docs/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{% extends "!layout.html" %}

{%- block footer %}
<footer class="footer" style="border-top: 1px solid #ccc; padding-top: 10px">
<div class="container">
<div id="credits" style="width: 50%; float: left">
<p>
{% trans copyright=copyright|e %}&#169; Copyright {{ copyright }}, <a href="https://www.simonsfoundation.org/people/edoardo-balzani/">Edoardo Balzani</a>.{% endtrans %}<br/>
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> and the <a href="https://pydata-sphinx-theme.readthedocs.io/en/stable/">PyData Theme</a>.<br/>
</p>
</div>
<div id="version" style="color: #999; float: right; margin: 15px">v{{ version }}</div>
</div>
</div>
</footer>
{%- endblock %}
42 changes: 42 additions & 0 deletions docs/assets/stylesheets/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,45 @@ html[data-theme=light]{
.toctree-l4 {
font-weight: normal;
}

/* Add a line separator above the entire footnote list */
aside.footnote-list {
border-top: 1px solid #ccc; /* Add a horizontal line */
margin-top: 2em; /* Space above the separator */
padding-top: 1em; /* Space below the separator */
}

/* Style each individual footnote */
aside.footnote {
margin-bottom: 1em; /* Add space between footnotes */
font-size: 0.9em; /* Adjust font size */
color: #333; /* Text color */
}

/* Style the label (the bracketed number) */
aside.footnote .label {
font-weight: bold; /* Make it stand out */
margin-right: 0.5em; /* Add space after the label */
}

/* Style the brackets */
span.fn-bracket {
color: #666; /* Dim the brackets */
}

/* Style the links within the footnotes */
aside.footnote a {
color: #007BFF; /* Blue link color */
text-decoration: none; /* Remove underline */
}

aside.footnote a:hover {
text-decoration: underline; /* Add underline on hover */
}

/* Adjust spacing for the paragraph inside the footnote */
aside.footnote p {
margin: 0.5em 0;
line-height: 1.5; /* Improve readability */
}

4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@


project = 'nemos'
copyright = '2024, SJ Venditto'
author = 'SJ Venditto'
copyright = '2024'
author = 'E Balzani'
version = release = nemos.__version__

# -- General configuration ---------------------------------------------------
Expand Down
26 changes: 16 additions & 10 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,11 @@ Once the basis is initialized, you can call `compute_features` on an input of sh
`(n_samples, n_signals)` to perform the convolution. The output will be a 2-dimensional array of shape
`(n_samples, n_basis_funcs)` or `(n_samples, n_basis_funcs * n_signals)` respectively.

!!! warning "Signal length and window size"
The `window_size` must be shorter than the number of samples in the signal(s) being convolved.
:::{admonition} Signal length and window size
:class: warning

The `window_size` must be shorter than the number of samples in the signal(s) being convolved.
:::

```python

Expand Down Expand Up @@ -279,11 +282,11 @@ You can specify the regularization scheme and its strength when initializing the
## **Pre-processing with `pynapple`**


!!! warning

This section assumes some familiarity with the `pynapple` package for time series manipulation and data
exploration. If you'd like to learn more about it, take a look at the [`pynapple` documentation](https://pynapple-org.github.io/pynapple/).
:::{info}

This section assumes some familiarity with the `pynapple` package for time series manipulation and data
exploration. If you'd like to learn more about it, take a look at the [`pynapple` documentation](https://pynapple-org.github.io/pynapple/).
:::

`pynapple` is an extremely helpful tool when working with time series data. You can easily perform operations such
as restricting your time series to specific epochs (sleep/wake, context A vs. context B, etc.), as well as common
Expand Down Expand Up @@ -321,9 +324,10 @@ A canonical example of this behavior is the `predict` method of `GLM`.
Let's see how you can greatly streamline your analysis pipeline by integrating `pynapple` and NeMoS.


!!! note
You can download this dataset by clicking [here](https://www.dropbox.com/s/su4oaje57g3kit9/A2929-200711.zip?dl=1).
:::{note}

You can download this dataset by clicking [here](https://www.dropbox.com/s/su4oaje57g3kit9/A2929-200711.zip?dl=1).
:::

```python

Expand Down Expand Up @@ -426,9 +430,11 @@ Fit a 5-fold cross-validation scheme for comparing two different regularizer str
```


!!! info "Cross-Validation in NeMoS"
:::{admonition} Cross-Validation in NeMoS
:class: info

For more information and a practical example on how to construct a parameter grid and cross-validate hyperparameters across an entire pipeline, please refer to the [tutorial on pipelining and cross-validation](../generated/how_to_guide/plot_06_sklearn_pipeline_cv_demo).
For more information and a practical example on how to construct a parameter grid and cross-validate hyperparameters across an entire pipeline, please refer to the [tutorial on pipelining and cross-validation](../generated/how_to_guide/plot_06_sklearn_pipeline_cv_demo).
:::

Finally, we can print the regularizer strength with the best cross-validated performance:

Expand Down

0 comments on commit c43c6f9

Please sign in to comment.