topsim: Similarity search

View source: R/MPMcore.R

topsimR Documentation

Similarity search

Description

Vector similarity search across a reference dataset.

Usage

topsim(
  v,
  x = mpm.us,
  f = "cosine",
  k = 5,
  p = 0.7,
  features = 2:15,
  check.data = TRUE,
  ...
)

Arguments

v

An input vector of length equal to the number of columns of the reference data.frame (see below).

x

Reference data.frame. If no reference is specified, the default simulated dataset (object mpm.us) will be used.

f

Similarity function. Available functions: "cosine", "jaccard", "euclidean", "pearson", "spearman", "kendall" (default = "cosine").

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).

features

Indices of the features (columns) in x used to compute similarity (default = 2:15).

check.data

Logical value. If TRUE (default), the input data type is checked.

...

Currently ignored.

Value

A list of 4 objects:

  1. "signature", metastatic risk signature (MRS);

  2. "p", MRS-associated malignancy risk (evaluated as positive predictive value, according to Fragomeni et al. 2022);

  3. "ci95", 95

  4. "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).

Author(s)

Fernando Palluzzi fernando.palluzzi@gmail.com

References

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 Also

See us.predict to launch all morphonode modules at once. See also ranksim for ultrasound profile similarity ranking.

Examples


# 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)

# Top-similar profiles
sim <- topsim(u$ultrasound)
print(sim)


Morphonodepredictivemodel/morphonode documentation built on Feb. 15, 2023, 4:51 a.m.