Skip to content

OTCP tutorial #613

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

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

OTCP tutorial #613

wants to merge 4 commits into from

Conversation

EugeneNdiaye
Copy link
Collaborator

base draft tutorial otcp

base draft tutorial otcp
@EugeneNdiaye EugeneNdiaye added the documentation Improvements or additions to documentation label Mar 11, 2025
@EugeneNdiaye EugeneNdiaye self-assigned this Mar 11, 2025
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@EugeneNdiaye EugeneNdiaye marked this pull request as ready for review March 21, 2025 13:25
@EugeneNdiaye EugeneNdiaye requested a review from michalk8 March 21, 2025 13:25
@@ -0,0 +1,780 @@
{
Copy link
Collaborator

@michalk8 michalk8 Apr 1, 2025

Choose a reason for hiding this comment

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

  • please remove the unused RandomForestRegressor
  • for imports (either ours or external packages), let's not import the classes directly (e.g., from ott.tools.conformal import OTCP), but let's use, e.g. from ott.tools import conformal and later otcp = conformal.OTCP(...). Same applies for the sklearn packages.

Reply via ReviewNB

@@ -0,0 +1,780 @@
{
Copy link
Collaborator

@michalk8 michalk8 Apr 1, 2025

Choose a reason for hiding this comment

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

Line #1.    random_state = 414

Not used, please use when initializing the model.


Reply via ReviewNB

@@ -0,0 +1,780 @@
{
Copy link
Collaborator

@michalk8 michalk8 Apr 1, 2025

Choose a reason for hiding this comment

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

I think it's important we add link to the original dataset where it comes from. Furthermore, since we're downloading from the 2nd publication you mention, I'd mention only that one + add it as a citation in the bibliography and use {cite}dheur:25.


Reply via ReviewNB

@@ -0,0 +1,780 @@
{
Copy link
Collaborator

@michalk8 michalk8 Apr 1, 2025

Choose a reason for hiding this comment

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

No need to have display(df.head()), you can just to df on the last line when executing the notebook cell.


Reply via ReviewNB

@@ -0,0 +1,780 @@
{
Copy link
Collaborator

@michalk8 michalk8 Apr 1, 2025

Choose a reason for hiding this comment

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

This is not really necessary, please remove.


Reply via ReviewNB

@@ -0,0 +1,780 @@
{
Copy link
Collaborator

@michalk8 michalk8 Apr 1, 2025

Choose a reason for hiding this comment

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

Line #34.        x=confidence_regions[idx, :, 1].flatten(),

Don't think .flatten() is needed.


Reply via ReviewNB

@@ -0,0 +1,780 @@
{
Copy link
Collaborator

@michalk8 michalk8 Apr 1, 2025

Choose a reason for hiding this comment

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

Line #42.        label="Contour of Confidence Region",

This can also be removed, it's not being shown.


Reply via ReviewNB

@@ -0,0 +1,780 @@
{
Copy link
Collaborator

@michalk8 michalk8 Apr 1, 2025

Choose a reason for hiding this comment

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

Line #46.    ax.set_xlim(40.68, 40.8)

Same here, would remove the limits.


Reply via ReviewNB

@@ -0,0 +1,780 @@
{
Copy link
Collaborator

@michalk8 michalk8 Apr 1, 2025

Choose a reason for hiding this comment

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

Line #3.    y_candidates = jnp.array(Y_train[:500])

Maybe it would be more interesting here to provide a 2D grid instead of sampling the candidates from y_train. 


Reply via ReviewNB

@@ -0,0 +1,780 @@
{
Copy link
Collaborator

@michalk8 michalk8 Apr 1, 2025

Choose a reason for hiding this comment

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

Line #48.    plt.show()

No need for plt.show().


Reply via ReviewNB

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

Successfully merging this pull request may close these issues.

2 participants