mlr-org / mlr3gallery

Case studies using mlr3
https://mlr3gallery.mlr-org.com
21 stars 9 forks source link

Pro tipps: mlr3 & R6 #40

Open danielsaggau opened 4 years ago

danielsaggau commented 4 years ago

Illustration of basic components of mlr3 and how they are composed. E.g. Tasks, measures, resampling and syntax

pfistfl commented 4 years ago
pat-s commented 4 years ago

Wouldn't most of this be redundant with the mlr3book? Not sure if this is the right place for this.

Or what is meant exactly by "how are they composed"? The gallery should not be about explaining technical details of mlr3 R6 code.

berndbischl commented 4 years ago

first of all, i don't understand what the issue is about? the text is so short that it's very hard to guess what the suggestion is. please write at least complete sentences?

furthermore, I am probably with Patrick in that this is more a section for the book. but can we please clear up first what you guys are missing?

danielsaggau commented 4 years ago

So the idea was to have a sort of quick refresher just showing the different arguments of different functions etc as we had prior in the German credit use case (section now removed) just to provide a sort of overview of what there is. Its a sort of minimalistic cheatsheet rather than explaining the whole package. It was useful for me at least while working with mlr3 &R6.

E.g.

Appendix

mlr_learners
mlr_tasks
mlr_measures
mlr_resamplings
formals(TaskClassif$public_methods$initialize)

etc.

berndbischl commented 4 years ago

sorry :) I am still not exactly sure. can you please explain more? really concrete examples would help.

  • What are the arguments of lrn(), tsk()

but that's has nothing to do with R6? that's mlr3 syntax sugar? what was confusing to you as a person here? surely we want to improve docs then.

  • What are the arguments of a $new() constructor?

wouldn't you simply read the help page for this?

danielsaggau commented 4 years ago

Technically this would be not more than an overview and indeed you can look all these things up with the help function or the cheatsheet or the book. This is sort of just a convenience thing to have it in the gallery, all on one page. It is not intended to be as exhaustive as the help function or the book but rather a sort of overview when looking something up quickly for people that are somewhat familiar already.

berndbischl commented 4 years ago

daniel... sorry ... i STILL dont really understand what you want. can you not maybe, just with a bit more text, really explain what that would be? concretely? precise?

danielsaggau commented 4 years ago

Of course. I am sorry if I have not expressed myself in a clear manner. So, while working on the titanic use case I was going through the gallery and specifically this basics use case on German credit was pretty useful while getting started:

https://mlr3gallery.mlr-org.com/posts/2020-03-11-basics-german-credit/

I really liked the appendix section (right at the bottom) in this use case because it was a nice but brief overview and just practical overall for me personally. Initially I wanted to add this to the titanic basics use case, but upon suggestion I made it a separate issue as it was argued that it may be useful for other basics cases, too. So, to be concrete what I had in mind was something like this appendix section as a individual document. That is basically all the thought I have put into it, myself. I hope that makes sense. If not, let me know.

danielsaggau commented 4 years ago

Upon second thought, the same effect may also by accomplished by linking other existing material. This does not have to be a separate gallery post but maybe one could link e.g. the respective cheatsheet to the different posts or something like that. I just felt that information like that helped while working on the use cases, thats all. And adding such knowledge in an accessible manner makes it easier for people to get started.

pfistfl commented 4 years ago

So I basically told @danielsaggau to create this issue, the idea behind is the following:

Many of those things are and should and are somewhat be covered in the corresponding help files, but not always. Additionally, I do not always want to parse through the full help file to just find how an argument is named exactly etc.

So what I had envisioned is a "tips and tricks" post that sort of covers practical, general aspects. Additionally, I see no problem in explaining things twice from different perspectives.

berndbischl commented 4 years ago

I really liked the appendix section (right at the bottom)

ok. THANKS. that was helpful, I now understand better.

Initially I wanted to add this to the titanic basics use case

I don't like this, this creates redundancy, stuff like this is really useful, but it should be in ONE place, the BEST place - and then linked to.

  • There are a lot of "tips and tricks

I would have been nice then to mention more than one... I agree with the "tab completion". But... I am really just trying to understand.

Many of those things are and should and are somewhat be covered in the corresponding help files

no, I HOPEFULLY get what you want now. this is not really explained in the helpfiles.

------------>

But: I kinda disagree that this should be gallery post. And I don't really understand why this shouldn't fit into the book? This is GENERAL stuff? It could also maybe be a cheatsheet but I would put it first into the book

pat-s commented 4 years ago

There are a lot of "tips and tricks" on how to work with R6 objects, mlr3 and so on which do not fit too well into the book, i.e. things like tab-completion.

When it comes down to this, then it is about how to deal with R or R6 in general / a "best practices" setup - this has nothing to do with mlr3 then and I'd say this is not suited for a post in the mlr3gallery? While I see the usefulness in general, this is more about "how to get around in R as a new/unexperienced user". Not sure if we should open this door.

pfistfl commented 4 years ago

I don't see any harm in "opening that door" as we do not and never will aim to cover this all, but this would make mlr3 way more accessible to users. And in general, I saw the gallery as something where we can sort of publish anything related to mlr3?