[code] suggestion for the next session

Since we are constantly copy-pasting code from notebooks here and there, maybe would be worth having a «snippets» tab on the top with typical blocks of code

This is a great idea. I know that we have a javascript plugin when we used sphinx.
It might be great to have something similar in FUN. However, I am not a frontend guy :slight_smile:

@lesteve @lfarhi @MarieCollin @brospars Do you think that this is feasible?

1 Like

I know that we have a javascript plugin when we used sphinx.

Je crois que Guillaume pensait à Sphinx-copybutton — Sphinx Copybutton qui utilise ClipboardJS.

Yes exactly. We discussed with @lesteve and I should specify that I was thinking about copy-pasting a snippet of the HTML <code> tag that we used in quizzes and solutions. It is different from the original proposal indeed :slight_smile:

@thomasbb just to be sure what use case(s) do you have in mind?

  1. copying and pasting from lesson notebooks into exercise notebooks
  2. copying from quizzes instructions or solutions into exercise notebooks
  3. other use cases (if so, please add a few more details)

Also just a remark, in an ideal world after some time, it would be great if you are able to write the code yourself without copying and pasting :wink:.

Having said that, a snippet tab with the most common code snippets may be something to consider for the next session. In my opinion, the FUN-MOOC interface should have a search feature to easily find code snippets like this … in the mean time you can search in our JupyterBook for example if I want to find ColumnTransformer: https://inria.github.io/scikit-learn-mooc/search.html?q=ColumnTransformer

1 Like

It was rather from lessons notebooks into exercises, because navigating through notebooks has always been a pain the neck (which has nothing to do with the Mooc).
The right way to do is to code the calls to scikit-learn ourselves, but having no prior knowledge neither in Machine Learning nor in Pandas, I’m crying my eyes out (which has nothing to do with the Mooc neither)

OK thanks for the details! I am going to tag this as a suggestion for the v2.

You can find the executed and rendered versions of the notebooks in https://inria.github.io/scikit-learn-mooc maybe that can help a bit finding some snippets.

I am not sure how best to address the overall issue, it seems like there are a few slightly different things here:

  • pandas: the pandas knowledge is spread throughout all the notebooks, for now we use 10 minutes to pandas — pandas 1.2.4 documentation to point people that needs a quick start / refresher on pandas
  • scikit-learn: general question i.e. “I am not sure which scikit-learn object I need to use to answer the question”. Not sure that there is a better way than going back to the previous notebooks and reread them to find something similar in spirit.
  • scikit-learn snippet: I know I have to use a ColumnTransformer but I need a snippet to help me write the code. We could have a “useful snippets” tab (like the glossary one) with a quick (probably not stand-alone snippet) and a link to the notebooks where the object is used. The problem is that we would need to do this by hand so this would not be that easy to maintain.
2 Likes

For completeness I tracked @glemaitre58’s suggestion (make it easier to copy quizzes solution snippets into the clipboard) in our github repo: Make it easier to copy solution snippets into the clipboard · Issue #367 · INRIA/scikit-learn-mooc · GitHub

1 Like

The rendered versions are great, it makes parsing the notebooks far easier. Thank you for the link.
The third bullet point is what I had in mind. Usually, I work on the Mooc at week-ends so I keep only a mean idea about where the objects are introduced. Having a not stand-alone glossary would be very handy indeed.
And regarding Pandas, a web search does the job anyway so no big deal about it
(Apologies for giving you extra-homework)

The rendered versions are great, it makes parsing the notebooks far easier.

Glad to hear that!

I work on the Mooc at week-ends so I keep only a mean idea about where the objects are introduced. Having a not stand-alone glossary would be very handy indeed.

Thanks a lot for taking the time to explain your problem in detail! This is very useful to have feed-back on this kind of pain points. These pain points are rather likely shared by other MOOC participants but not everyone is going to find the time to complain about them in a constructive way :wink:.

I am also learning Python, Pandas, Numpy, Matplotlib through this course, and this very issue of copy / pasting snippets of code here and there is another reason why I am running the MOOC locally (someone on the team previously asked why do I run locally Running locally - #7 by Marc_In_Singapore).

I keep all Jupyter tabs of each lesson, exercice, quizz open and it’s faster that way to find the relevant code.

I hope I’ll be able to walk by myself when I grow up in Python…

I think this one is good enough the copy clipboard functionality is tracked in github, making a snippets is a bit akward because we would not have a way to test it so removing the priority-v2 tag …