Learn R Programming

GMC (version 0.1.2)

GMC_feature_ranking: Feature selection using GMC ranking

Description

Feature selection using GMC ranking

Usage

GMC_feature_ranking(X, Y, kernel = dnorm, sort = TRUE)

Value

A data.frame with variable names and GMC scores

Arguments

X

A matrix or data.frame of predictors

Y

A numeric response vector

kernel

Kernel function (default = dnorm)

sort

Logical, whether to sort variables by GMC score

Examples

Run this code
# Generate sample data with multiple predictors
set.seed(123)
n <- 500
X1 <- rnorm(n)
X2 <- rnorm(n)
X3 <- rnorm(n)
Y <- 2 * X1 + X2^2 + rnorm(n, sd = 0.5)
X <- cbind(X1, X2, X3)

# Rank features by GMC
ranking <- GMC_feature_ranking(X, Y)
print(ranking)

Run the code above in your browser using DataLab