data(genes_example)
# Greedy pruning for high-dimensional data
gene_data <- genes_example[, -(1:2)] # Exclude ID and outcome
pruned <- corrPrune(gene_data, threshold = 0.8, mode = "greedy")
ncol(pruned) # Reduced from 200 to ~50 genes
# Use pruned genes for classification
pruned_with_outcome <- data.frame(
disease_status = genes_example$disease_status,
pruned
)
Run the code above in your browser using DataLab