Lesson 10 Discussion & Wiki (2019)

Why would **kwarg be needed even in the Jeremy’s example within the notebook? If the if the arguments are not needed for before_calc or after_calc, why pass it through? If there’s a function needs that value, can you just use a different function? Can you overload a callback?

I think it was to present that kwargs are that he used them.

Out of curiosity: how would one implement broadcasting with things like __add__? Because it’s between two different objects, I don’t really see how

1 Like

To make callbacks compatible, I guess. Like, if you have:

cb.before_calc(a=1, b=2)

All callbacks should have these params. But kwargs allow you to pass anything you want, and use only what you need.

cb.before_calc(**params)
2 Likes

Probably some type checking. Not a specialist of that so I might be wrong.

So when you do a+b, what happens exactly? a.__add__(b)or the opposite?

1 Like

There is also __radd__, so you can override both to get behaviour you would like.

1 Like

I’ve used plugins that allow VSCode to edit code on a remote server … but it is kinda kludgy (no intellisense, no way to jump around, etc…).

Anyone know if this has improved?

This might be a bit outdated, but I’ve always found Rafe Kettler’s “A Guide To Python’s Magic Methods” a fantastic resource: https://rszalski.github.io/magicmethods/ (the first place I was able to find it online just now)

6 Likes

What is the ACK equivalent on VS Code? I haven’t been able to figure it out so far.

Is it possible to configure vim tags to be conda env specific?

Yeah, seems to be a great explanation of the topic.

can nano do this stuff?

higher the std deviation between the features ,better would be to train using those features ?

@nbharatula I believe it’s just a find all. Most likely jeremy is using ack from bash

See: https://stackoverflow.com/a/38577546

1 Like

Why is the standard deviation easier for statisticians than the mean absolute deviation? Does it have to do with differentiability?

No, it’s because it has nicer mathematical properties. Like the one Jeremy stated to compute variance, or the fact we have V(XY) = V(X)V(Y) when X and Y are independent and of zero mean.

So in general, it’s far easier to compute than the mean absolute variation.

4 Likes

Or maybe something like this Vim plugin

Is there a good visualisation for all of these stats terms? One single plot for all on same dataset? (Dang, Jeremy just asked us to plot it ourselves.)

Oh. That’s what I’ve been using but Find all doesn’t let me go back n forth in the files within VSCode.