eugeneyan / eugeneyan-comments

1 stars 1 forks source link

https://eugeneyan.com/writing/design-patterns/ #57

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

Design Patterns in Machine Learning Code and Systems

Understanding and spotting patterns to use code and components as intended.

https://eugeneyan.com/writing/design-patterns/

sylviachency commented 2 years ago

Great article! Is "src" a python package?

eugeneyan commented 2 years ago

Yes, but in the sense that its something you can pip install. It's just a directory where I put my code. You can find an example here.

alistairwgillespie commented 2 years ago

Thank you, Eugene! Great read.

For the adapter pattern, I'm not quite understanding the definition, "the adapter pattern increases compatibility between interfaces".

In your pandas example, attempting to apply your definition, each read* is a unique interface that generates a common object, a dataframe. Are you saying that the dataframe and the read* are two interfaces?

Your work is really appreciated.

swaroop4learning commented 2 years ago

Nice info Eugene. Here are few observations:

  1. Traditional Factory pattern is not much applicable to Python and examples like hugging face achieving through composition is recommended.
  2. Decorator pattern is different from decorators in python. Both are not exactly same. Please verify my observation.