End-to-end implementation of a machine learning pipeline (2017)
spandan-madan.github.io
End-to-end implementation of a machine learning pipeline (2017)
1–10 of 45 posts
Re: End-to-end implementation of a machine learning pipeline (2017)
#2For future tutorial suggestions, mail me at smadan@mit.edu. A new one on NLP is coming soon!
Re: End-to-end implementation of a machine learning pipeline (2017)
#3Re: End-to-end implementation of a machine learning pipeline (2017)
#4For feature requests on this, please create an issue on the github Repo! For future tutorial suggestions, mail me at smadan@mit.edu. A new one on NLP is coming soon!
Genre_ID_to_name=dict([(g['id'], g['name']) for g in list_of_genres])
In other places, you would benefit a lot from the enumerate(..) function, which returns (index, item) tuples when called on a list.
Re: End-to-end implementation of a machine learning pipeline (2017)
#5For feature requests on this, please create an issue on the github Repo! For future tutorial suggestions, mail me at smadan@mit.edu. A new one on NLP is coming soon!
Is your code intentionally verbose (for the sake of being explicit)? It seems like it could be condensed a lot by using Pythonic structures. For example you could replace block 39 with a one-liner: Genre_ID_to_name=dict([(g['id'], g['name']) for g in list_of_genres]) In other places, you would benefit a lot from the enumerate(..) function, which returns (index, item) tuples when called on a list.
Re: End-to-end implementation of a machine learning pipeline (2017)
#6Earlier quoted context omitted.
Is your code intentionally verbose (for the sake of being explicit)? It seems like it could be condensed a lot by using Pythonic structures. For example you could replace block 39 with a one-liner: Genre_ID_to_name=dict([(g['id'], g['name']) for g in list_of_genres]) In other places, you would benefit a lot from the enumerate(..) function, which returns (index, item) tuples when called on a list.
Precisely. I strongly believe that the purpose of tutorials is to be inclusive of all people. That's something I realized as a TA, making things explicit never hurts. There's always someone who can gain from more detail :)
Re: End-to-end implementation of a machine learning pipeline (2017)
#7An earlier discussion: https://news.ycombinator.com/item?id=14781888
Re: End-to-end implementation of a machine learning pipeline (2017)
#8For feature requests on this, please create an issue on the github Repo! For future tutorial suggestions, mail me at smadan@mit.edu. A new one on NLP is coming soon!
Re: End-to-end implementation of a machine learning pipeline (2017)
#9Earlier quoted context omitted.
Is your code intentionally verbose (for the sake of being explicit)? It seems like it could be condensed a lot by using Pythonic structures. For example you could replace block 39 with a one-liner: Genre_ID_to_name=dict([(g['id'], g['name']) for g in list_of_genres]) In other places, you would benefit a lot from the enumerate(..) function, which returns (index, item) tuples when called on a list.
Precisely. I strongly believe that the purpose of tutorials is to be inclusive of all people. That's something I realized as a TA, making things explicit never hurts. There's always someone who can gain from more detail :)
It is a suspect proposition that anything is gained by turning 3 lines of code into one line of code. Unless it is javascript for the Google homepage or somesuch where the bytes matter. Moving code from a bad data model to a good one usually correlates with a big reduction in line count, but the gain is in choosing more appropriate data structures and not in the number of lines removed.
Every reader of code, including the author after 3 months, is going to have to read and understand the code from scratch. One line doing a multidimensional transform of the data is going to scan for a small fraction of people. That one liner would take about 3 times as long to understand as any one line of the tutorial code. The data model hasn't changed either. If anything, I'd argue that the nature of the transform being done is clearer in 3 lines.
Re: End-to-end implementation of a machine learning pipeline (2017)
#10For feature requests on this, please create an issue on the github Repo! For future tutorial suggestions, mail me at smadan@mit.edu. A new one on NLP is coming soon!
Is your code intentionally verbose (for the sake of being explicit)? It seems like it could be condensed a lot by using Pythonic structures. For example you could replace block 39 with a one-liner: Genre_ID_to_name=dict([(g['id'], g['name']) for g in list_of_genres]) In other places, you would benefit a lot from the enumerate(..) function, which returns (index, item) tuples when called on a list.
id_to_name = {g['id']: g['name'] for g in list_of_genres}
And for i in range(len(list_of_genres))
is really a dangerous antipattern better replaced with for genre in list_of_genres: