New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
simplifying API #105
Comments
Hi there, I'm Ryan. I found your project through the Mozilla Sprint. This issue sounds like something I can work on. I have a few questions to clarify.
|
Hi Ryan! We'd love to have you help out! Regarding your questions - In regards to the first bullet point, where does the alignment algorithm fit in with normalization and reduction? From details of the other bullet points, it sounds like alignment should come after reduction. So should order of operations be: normalization, reduction, then alignment? I believe the order should be normalize -> align -> reduce. @jeremymanning can you verify this order of transforms? The plot function (hyperplot.plot) has many keyword args. Should I add the align flag at the end, or maybe somewhere in the middle? I think standard practice is to put the more heavily used arguments closer to the front. I would put that right after the ndims flag (i clustered the 'data transforms' in that section). It should be false by default, and throw an error if the len(x) < 1 (its doesn't make sense to 'align' something to itself). If you could add a short description to the doc string, that would also be helpful. you can find info on the operation in the docstring of Let me know if any questions come up! you can leave comments here, or in our gitter: https://gitter.im/hypertools/Lobby |
For plotting, I think we want normalize --> reduce --> align. This is because:
Re: the positions of the new keyword arguments, @andrewheusser's suggestion looks good to me... |
Thanks guys, your comments are helpful. Also, in regards to bullet point 3, how would you like the matrices to be zero padded? Should they be padded on the left, on the right, on both edges equally (if padding width is even)? Maybe there could be an extra kw arg |
Great question! None of the functions should pad with zeros, except The basic assumption we make in
The exception to all of this is |
@jeremymanning - re dataframes, we do not do any reordering. If the input data is a dataframe (or list of dfs) we:
I'll add an issue to check to see if the column labels are the same across dfs when reducing. if they are the same, just out of order, they will be resorted. @rarredon I will be working on hypertools all day today, so ping me if you need clarification as things come up! |
Okay, so I'll finish up the other parts, and forget the part about zero padding. Should be done soon! |
That's great @rarredon-- thanks! |
Thanks @rarredon! Closing this issue... |
Actually...re-opening, sorry. I realized: the tutorials on readthedocs still need updating. |
(Should be done only after we push the next version of hypertools to pip) |
do you mean adding some examples using these new features to the gallery? @lucywowen is working on some tutorials like http://cdl-quail.readthedocs.io/en/latest/tutorial.html, but those are still underway |
No-- I just mean updating the current examples (e.g. align, reduce, etc.) to use the simpler syntax. But the tutorials will be helpful too! |
Got it! I updated all the examples and created a log of the changes, ready for pip? |
ready for pip-- pip, pip, pooray! 🎉 |
eek-- wait!!! saving animations is now crashing...
|
^ this also seems to affect 0.2.0 😿 |
do you have the most version of master? i patched that |
ah-- nvm; just installed directly from git and it works again. sorry for the scare. |
all good! pushing to pip! |
The API could be simplified in a few places. For example:
hyp.plot
we could include analign
flag that runshyp.tools.align
on the data if set toTrue
(default:False
).hyp.tools.align
andhyp.tools.procrustes
we could include andims
flag that runshyp.tools.reduce
on the dataset prior to alignment if notNone
(default:None
)hyp.tools.align
andhyp.tools.procrustes
, if the data matrices don't have the same numbers of features, we should zero-pad all of the matrices to ensure they have the same number of features as the matrix with the most featureshyp.tools.load
we could includealign
andndims
flags that pass the data through the appropriate other functions (hyp.tools.reduce
, followed byhyp.tools.align
) so that the reduced/aligned data are returned from the start, without needed to save extra copies of the datasetThe text was updated successfully, but these errors were encountered: