Comments (9)
Thank you for your interest in our work!
To get the scaling factor, you can call the function _scale_array
after importing,
from procrustes.utils import _scale_array
And the scaling factor can be accessed as the second element of the returned tuple. More details
https://github.com/theochem/procrustes/blob/8454b837fbf0ce1cf695b736b5e145108849ef32/procrustes/utils.py#L158-184.
For translation matrix, it's almost the same.
from procrustes.utils import _translate_array
For changing the return to include these two elements, is this a often case in your field? We may discuss within our team and then get it back to you.
@esoinila
from procrustes.
Thanks for the quick reply. I will test those methods on Monday.
My use case is the case where I want to add new datapoints into 3D word without changing the original 3D world coordinates. Suppose in-door navigation with something like bluetooth signal strength giving approximate distances to devices as distance matrix. For some beacons we know their positions beforehand (we have placed them into indoor-space intentionally into known locations as beacons). Ideally we want to use these known positions to calculate a transition for putting the new distance matrix point(s) on the 3D-map into correct position(s) (a new point could be your phone with bluetooth on).
Instead of comparing points from distance matrix to known point positions in arbitrary scaled/translated coordinates on the axes we could have correct 3D-world coordinates (from matrix b) on the axes (see image).
One way to accomplish this robustly would be to get used scale and translation so these changes can be reversed (this is my current approach). Even fancier option would be to have an option to use b-matrix coordinates in results.
The map-use-case in Ivan Dokmanics et alls article http://dokmanic.ece.illinois.edu/assets/pdf/Dokmanic2015eg.pdf is quite close to my use-case (FIGS1 box on page 13) except that it is in 2D.
from procrustes.
@fwmeng88 and @FarnazH: we should think about whether we want to return the scale/translate or support it only as @fwmeng88 mentions. It is a substantial revision (albeit an easy one) to adjust all the returns.
I don't have a strong feeling for pros vs. cons. If we were doing it all over again, I guess that returning the translation/scaling automatically might have been sensible. The con I see is only that it makes the return a lot more complicated, and the scaling/translation is not always done (it's an option) and so we want to return None
that frequently?
It may be that a documentation fix is more appropriate, then. Y'all's thoughts? We might at least not make these methods "hidden/internal" methods.
from procrustes.
@fwmeng88
Thanks,
The use of:
from procrustes.utils import _scale_array from procrustes.utils import _translate_array scaled_a, scale = _scale_array(a,b) translated_a, reverse_vector = _translate_array(a,b)
seems to work in jupyter notebook, even though those methods start with underscore.
from procrustes.
No problem at all.
Yes, these are private functions, but it's great that it's useful for you. Please let me know if you have further questions. @esoinila
from procrustes.
I thought about this again and maybe we don't need to have a return of scaling factor or translation matrix as in most cases, this makes too many returns. I would favor clear documentation, somewhere like https://procrustes.qcdevs.org/notebooks/Quick_Start.html? @PaulWAyers @FarnazH
from procrustes.
Can you update the documentation and close this issue @FanwangM ?
from procrustes.
Just to be clear, this is in the quickstart.ipynb
Jupyter notebook.
@FanwangM I made a few tweaks to verbiage, which are hopefully OK.
from procrustes.
Thank you. I will take a look soon. @PaulWAyers
from procrustes.
Related Issues (20)
- Can't install from pip HOT 3
- Support of missing values for generalized Procrustes analysis
- L-1 procrustes HOT 10
- Installing with pip according to instructions does not work HOT 5
- Molecular Structure Distance HOT 1
- Non square data in softassign function - cannot reshape array HOT 4
- An alternative way of solving rotational Procrutes problem HOT 4
- Web Site HOT 2
- Add support of 1D, 2D and 3D molecular structures HOT 3
- translation, scling, weighting for positive semi-definite Procrustes problem HOT 2
- Deprecated `pinv2` function in `scipy.linalg` HOT 2
- Update the summary table when #98 is done
- Failing testing, `test_psdp_woodgate_non_full_rank` HOT 11
- More algorithms on `PSDP` HOT 18
- Another round of code review for GSoC HOT 1
- pinv2 deprecated HOT 12
- Support Weight Matrices
- One-Sided Procrustes for Toeplitz matrices HOT 5
- positive semi-definite Procrustes problem HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from procrustes.