SwapMissingClass: Swap portion of the missing classes from idx_ref to idx.

Description Usage Arguments Value

Description

Could be useful to re-construct idx and idx_ref with no missing classes. Set swap_ratio to 0 results in a relatively (but not globally) minimal swapping.

Usage

1
2
SwapMissingClass(idx, idx_ref, onehot, swap_ratio = 0.1,
  swap_random = FALSE)

Arguments

idx

a vector of sample indices.

idx_ref

a vector of reference sample indices.

onehot

a onehot table.

swap_ratio

ratio of swapped elements from reference samples.

swap_random

whether swapped elements are randomly selected by sample(), otherwise elements are selected in index order.

Value

a named list with new idx and idx_ref.


imlijunda/AwkwardMLTools documentation built on May 13, 2019, 11:33 a.m.