ranksim | R Documentation |
Filter, rank, and return the k top-similar ultrasound profiles respect to the input one, by searchin across a reference dataset. This function implements the similarity profiling module (Moprhonode-SP).
ranksim( u, v = NULL, x = mpm.us, k = 5, p = 0.7, j = 2:15, d = c(2:6, 9, 10, 11), signature = NULL, check.data = TRUE, orderbyDistance = FALSE, ... )
u |
An ultrasound vector generated by
|
v |
An ultrasound profile generated by
|
x |
Reference ultrasound data.frame. If no reference is specified,
the default simulated dataset (object |
k |
Numeric value defining the number of top-k profiles to return after similarity ranking (default = 5). |
p |
Continuous value from 0 to 1 representing the minimum similarity value for an ultrasound profile to be included in the output (default = 0.7). |
j |
Indices of the features (columns) in |
d |
Indices of the features (columns) in |
signature |
One among "LMR", "MMR", "HMR", "MET" (default = NULL). Resctrict the similarity search to a given metastatic risk signature (if NULL, no signature restriction is applied). |
check.data |
Logical value. If TRUE (default), the input data type is checked. |
orderbyDistance |
Logical value. If TRUE, the k top-similar profiles are finally ordered by increasing euclidean distance (default = FALSE). |
... |
Currently ignored. |
The input ultrasound profile is compared to each entry in the reference dataset by computing pairwise similarity. By default, cosine similarity is used, while jaccard similarity is enabled if a binary vector is given. The hits are then filtered by minimum similarity (by default, > 0.7) and pairwise euclidean distance between them is computed. Results are then ranked by either decreasing similarity (default) or increasing distance.
A list of 4 objects:
"signature", metastatic risk signature (MRS);
"p", MRS-associated malignancy risk (evaluated as positive predictive value, according to Fragomeni et al. 2022);
"ci95", 95
"y.uss", naive guess of the outcome (0: non-malignant, 1: malignant), based on the MRS (this will be less accurate than the RFC-based prediction).
Fernando Palluzzi fernando.palluzzi@gmail.com
Fragomeni SM, Moro F, Palluzzi F, Mascilini F, Rufini V, Collarino A, Inzani F, Giacò L, Scambia G, Testa AC, Garganese G (2022). Evaluating the risk of inguinal lymph node metastases before surgery using the Morphonode Predictive Model: a prospective diagnostic study. Ultrasound xx Xxxxxxxxxx xxx Xxxxxxxxxx. 00(0):000-000. <https://doi.org/00.0000/00000000000000000000>
Leydesdorff L (2005). Similarity Measures, Author Cocitation Analysis,and Information Theory. In: JASIST 56(7), pp.769-772. <https://doi.org/10.48550/arXiv.0911.4292>
See us.predict
to launch all
morphonode modules at once.
See also topsim
for a simple similarity
search.
# Prepare a simulated malignant ultrasound profile x <- new.profile(us.simulate(y = 1)) u <- set.rfcdata(x, ref = mpm.us[, 2:15], levels = mpm.levels) v <- set.rbmdata(x, ref = mpm.us[, 2:15], levels = mpm.levels) print(u) print(v) # Rank using cosine similarity and the default simulated reference Rc <- ranksim(u$ultrasound) # Rank using jaccard similarity and the default simulated reference Rj <- ranksim(u$ultrasound, v$ultrasound) # Compare the two rankings print(Rc) print(Rj)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.