Ml distance - #57
Open
karan3242 wants to merge 31 commits into
Open
Conversation
Collaborator
Author
|
archaeothommy
requested changes
Aug 17, 2026
archaeothommy
left a comment
Owner
There was a problem hiding this comment.
Awesome work, thank you! Some of your helper functions will be very helpful for other functions in the package, too.
I edited documentation and vignettes directly there. Most edits are related to grammar and wording but please have a look. Additional questions and suggestions are inline.
I have no idea why testing your code fails since Mathias' commit. I did not check the statistics of your tests but will do so as soon as your code is running again.
|
|
||
| This is the method used by the function `pb_iso_prov_dist()` when the `dist_type` value is set to `"ed"`, which stands for 'Euclidean distance'. | ||
|
|
||
| According to @A.D.B+24, the standard method fails to account for statistical errors. These errors are addressed by weighting the data with the full covariance matrix $W$ of the NIST 981 lead isotope reference material. The adjusted distance is calculated as: |
Owner
There was a problem hiding this comment.
If "errors" here refer to the analytical uncertainties, please replace them with the proper term for them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Machine learning approach functions for Pb-iso-otope provence studies
Functions
This pull request adds 6 new functions.
The first is the pb_iso_emdmembers functions, which can identify PC-iso-EMD members forming a group using principal component analysis and geocrone-age lines using Stacey & Kramers, 1975. This creates a list object with the class "pbisoendmebers", which can be used with the S3 method of Summary.
The next main function in the as.ref_data function, which takes in any PB-iso-ate database and converts it into a ref.data object which can be used for Euclidean and machine-learing provenance studies.
The next function is the pb_iso_prov_dist function, which enables the traditional Euclidean distance with and without mass fractionation corrections applied. The mass fractionation correction is following the method laid out by Albarede et al., 2024.
The final two functions deal with creating an xgboost distance probability model which is trained on the ref.data object and then using the model to create predicted distance probabilities of individual sample points or "pbisoendmebers" class objects. This process is outlined by Shnyr et al., 2026.
Vignettes
The current pull request includes 2 new vignettes.
TODO
Currently a Vignet expelling the machine learning process is in the process of drafting and will push at a later date.
Imports
These sets of functions import the following:
References
Albarede, F., Davis, G., Blichert-Toft, J., Gentelli, L., Gitler, H., Pinto, M., & Telouk, P. (2024). A new algorithm for using Pb isotopes to determine the provenance of bullion in ancient Greek coinage. Journal of Archaeological Science, 163, 105919. https://doi.org/10.1016/j.jas.2023.105919
Shnyr, E., Kuflik, T., Desai, K., & Eshel, T. (2026). Determining the origins of Phoenician silver: Exploring the potential of machine learning for lead isotope analysis. Journal of Archaeological Science, 188, 106–499. https://doi.org/10.1016/j.jas.2026.106499
Stacey, J. S., & Kramers, J. D. (1975). Approximation of Terrestrial Lead Isotope Evolution by a Two-Stage Model. Earth and Planetary Science Letters, 26, 207–221.