Re:TensorFlow.js: Machine Learning for the Web and Beyond
by goatlover on Tuesday February 05, 2019 @02:21AM
(#19083548)
I understand wanting to use map or filter when things get more complex. Pandas has filter and apply methods for that. I agree that the JS versions are quite nice with the arrow functions and method chaining.
But for simpler operations, if you're doing a lot of vector computations, then map and filter bloat the code considerably when the mathematical notation is easy to read.
Good luck with work on the JS implementation and efficiency comparisons. Pandas utilizes a Series object built on top of NumPy array for handling columns and rows. I don't know whether a similar approach would be helpful in JS.
For JS, something similar to pandas creating a new column based on operations of other columns would be to do map an array of objects (list of dicts) and use a (Schwartzian_transform)[https://en.wikipedia.org/wiki/Schwartzian_transform] to create a new object property. I would love to look into how efficient these sort of operations can be, have had some success with this sort of thing for performing cosine similarity in the browser instead of creating sparse matrices with python.