Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update notebook Regression Models with Ordered Categorical Outcomes #578

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mihagazvoda
Copy link

@mihagazvoda mihagazvoda commented Sep 17, 2023

Issue 577

As a part of PyData Amsterdam PyMC sprint, I updated the notebook. I improved:

  • random values generation;
  • styling of math equations;
  • replaced univariate_ordered with ordered
  • filtered future warnings coming from pandas.

Note that pre-commit checks also affected a few other files.

Helpful links

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Contributor

@drbenvincent drbenvincent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mihagazvoda. Changes to the notebook look good. I've just left a comment about a few (unintentional?) changes to unrelated files.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are minor changes in this file which seem unrelated to the ordinal regression notebook that have snuck in accidentally?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was because of pre-commit. It happened the same of others, for example: #575
I think we should keep them otherwise everyone will have to manually remove them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are minor changes in this file which seem unrelated to the ordinal regression notebook that have snuck in accidentally?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are minor changes in this file which seem unrelated to the ordinal regression notebook that have snuck in accidentally?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are minor changes in this file which seem unrelated to the ordinal regression notebook that have snuck in accidentally?

@@ -20,6 +20,10 @@ kernelspec:
:::

```{code-cell} ipython3
import warnings

warnings.simplefilter(action="ignore", category=FutureWarning)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should aim to fix the warnings instead of ignoring them. Can you share what warnings you got? We might be able to help

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got:

[/Users/mihagazvoda/miniconda3/envs/pymc-dev/lib/python3.11/site-packages/arviz/stats/stats.py:307](https://file+.vscode-resource.vscode-cdn.net/Users/mihagazvoda/miniconda3/envs/pymc-dev/lib/python3.11/site-packages/arviz/stats/stats.py:307): FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'False' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  df_comp.loc[val] = (
[/Users/mihagazvoda/miniconda3/envs/pymc-dev/lib/python3.11/site-packages/arviz/stats/stats.py:307](https://file+.vscode-resource.vscode-cdn.net/Users/mihagazvoda/miniconda3/envs/pymc-dev/lib/python3.11/site-packages/arviz/stats/stats.py:307): FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value 'log' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  df_comp.loc[val] = (
[/Users/mihagazvoda/miniconda3/envs/pymc-dev/lib/python3.11/site-packages/arviz/plots/backends/matplotlib/compareplot.py:87](https://file+.vscode-resource.vscode-cdn.net/Users/mihagazvoda/miniconda3/envs/pymc-dev/lib/python3.11/site-packages/arviz/plots/backends/matplotlib/compareplot.py:87): FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
  scale = comp_df["scale"][0]

@OriolAbril OriolAbril changed the title Update notebook Regression Models with Ordered Categorical Outcomes #577 Update notebook Regression Models with Ordered Categorical Outcomes Aug 1, 2024
mihagazvoda and others added 2 commits August 1, 2024 23:04
@OriolAbril
Copy link
Member

I have rebased on main, and I think the warnings have all been fixed already by the respective libraries. However the notebook still needs to be executed start to end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants