get_k: get_k

View source: R/KLR_funs.R

get_kR Documentation

get_k

Description

'get_k()' is an internal function used by 'build_k()' to calcualte similarity kernel for each pair of observations

Usage

get_k(y1, y2, sigma, dist_metric = "euclidean")

Arguments

y1

- [NxP] Matrix of data from bag i

y2

- [NxP] Matrix of data from bag j

sigma

- [scaler] smoothing hyperparameters for RBF kernel

dist_metric

[character] One of the distance methods from rdist::cdist. Default = "euclidean". see ?rdist::cdist

Details

This function takes two data.frames or matricies, calculates the cross distance between them, and then applies a radial basis function to the resulting distance matrix.

Value

Matrix G


mrecos/klrfome documentation built on April 6, 2022, 8:02 p.m.