mi_knn: Mutual Information Calculation

Description Usage Arguments Examples

View source: R/mi_knn.R

Description

Mutual Information Calculation

Usage

1
2
mi_knn(dt, var.d, var.c, k = NULL, warnings = TRUE, FORCE = TRUE,
  global = TRUE, quite = FALSE)

Arguments

dt

a data.frame object

var.d

the name of the discrete variable in quotations

var.c

the name of the continuouse variable in quotations

k

the number of neighbors for MI calculation.

warnings

set to FALSE to hide warnings

FORCE

set to TRUE continues despite not using an optimum k

global

set to FALSE to get specific MI

quite

set to TRUE to prevent messages being displayed to the console

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
library(miknn)

#TCGA data
data("gene_exp",package = "miknn")
gene_exp

# basic example using k = 10
mi_knn(dt = gene_exp, var.d = "project", k = 10, var.c = "CCND1")

# the function can decide the optimum k
mi_knn(dt = gene_exp, var.d = "project", var.c = "CCND1")

# set global = FALSE to get the specific MI for each levels,  
mi_knn(dt = gene_exp, var.d = "project", var.c = "CCND1", global = FALSE)

# generating a plot for specific MI
res <- mi_knn(dt = gene_exp, var.d = "project", var.c = "CCND1", global = FALSE)
plot(res)

dbrookeUAB/miknn documentation built on Sept. 3, 2020, 9:47 a.m.