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

Docs #132

Closed
wants to merge 14 commits into from
Closed

Docs #132

wants to merge 14 commits into from

Conversation

sebffischer
Copy link
Member

Addresses #103

@sebffischer sebffischer requested a review from mllg August 8, 2022 10:10
@sebffischer
Copy link
Member Author

why do we have pre-commit in the ci?
What is circle ci?

@sebffischer
Copy link
Member Author

Why does pre-commit push into my commits?

@sebffischer
Copy link
Member Author

@pat-s

@mllg
Copy link
Member

mllg commented Aug 8, 2022

IDK if you have to touch each example. I think it would be better to demonstrate filtering in the book, and include the URL on the man pages of the filters. You could also plot the graph and show how to extract the filter values and the model.

@mllg
Copy link
Member

mllg commented Aug 8, 2022

So basically extend https://mlr3book.mlr-org.com/optimization.html#fs-filter and link here; having a smaller example in the README is also good.

@pat-s
Copy link
Member

pat-s commented Aug 8, 2022

IDK if you have to touch each example. I think it would be better to demonstrate filtering in the book, and include the URL on the man pages of the filters. You could also plot the graph and show how to extract the filter values and the model.

+1, also because just adding pipelines into the dep stack for this is not worth it.

Why does pre-commit push into my commits?

Why not? It just does what you should have done locally, rendering the man files.
I'd like to have it in repos I maintain, pre-commit is nothing new - we extensively discussed it during the last workshop.

@sebffischer
Copy link
Member Author

  1. I agree that making one nice example in the book and linking is better.
  2. @pat-s Adding mlr3pipelines to suggests is still required to be able to link to PipeOpFilter (see michel's original issue)

@pat-s
Copy link
Member

pat-s commented Aug 9, 2022

@pat-s Adding mlr3pipelines to suggests is still required to be able to link to PipeOpFilter (see michel's original issue)

Only if you use roxygen2 syntax. We have similar cases in other extension pkgs where we don't link via roxygen2 if this would be only reason to put a pkg into the dependency stack.

I'd really avoid having mlr3pipelines as a dep in here. Instead we can add a sentence into the help files which say "for examples how to use mlr3filters with mlr3pipelines, have a look at this book section".

@mllg
Copy link
Member

mllg commented Aug 12, 2022

Why is putting mlr3pipelines in Suggests a problem? This is only one more package in the CI (without any additional dependencies or system libraries), and no extra packages to install for the user.

Copy link
Member

@pat-s pat-s left a comment

Choose a reason for hiding this comment

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

Rethinking this, yes, given that it is an "internal" package the costs are low.
I tried to stick to the general approach of not including a package only for linking reasons in the documentation to keep the dependency chain small.
But we also have some actual use case here, so yes, let's include it.

Regarding examples: rethinking this as well and adding some pipelines snippets might be good. We should document this in the book in addition in more detail.

R/FilterCMIM.R Outdated
#' as.data.table(filter)
#' }
#'
#' if (requireNamespace("mlr3pipelines") && requireNamespace("praznik")) {
Copy link
Member

Choose a reason for hiding this comment

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

I'd favor using mlr3misc::require_namespaces(c("mlr3pipelines", "praznik")) in cases with n > 1.

Copy link
Member

Choose a reason for hiding this comment

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

Fine for me.

Copy link
Member

Choose a reason for hiding this comment

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

but it needs argument quietly = TRUE then 😞

#' library("mlr3pipelines")
#' task = mlr3::tsk("mtcars")
#'
#' graph = po("filter", filter = flt("carscore"), filter.cutoff = 0.2) %>>%
Copy link
Member

Choose a reason for hiding this comment

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

I'd avoid setting filter.cutoff as users might takes this as a "good default" then as its listed in an example.

I see you're setting a different value in each example. Should we calculate a random dynamic value and add a comment that this value should be tuned in practice?

Copy link
Member

Choose a reason for hiding this comment

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

Adding a comment that this value should be tuned: 👍

I don't think a random value is helping, this is just confusing.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think a random value is helping, this is just confusing.

Agree, this might not be obvious. Maybe the combination of a hardcoded value across all examples and a comment about the tuning need might be the best middle way.

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