Run Purity Weighted Nearest Shrunken Centroid Feature Selection

Provides a classifier independent filter method for high-dimensional gene-expression feature selection. The Run Purity Weighted Nearest Shrunken Centroid ('RPWNSC') score ranks genes by multiplying a run based purity score, which measures the compactness of class labels after sorting samples by each feature, by a scaled nearest shrunken centroid score, which measures standardized class centroid separation relative to within class variation. The top ranked features can then be used with downstream classifiers without wrapper search, feature clustering, or classifier dependent training. 'Amjad Ali, Zardad Khan, Saeed Aldahmani' (2026) .


RPWNSC

Run Purity Weighted Nearest Shrunken Centroid Feature Selection for high-dimensional gene-expression classification.

RPWNSC is a simple filter-based feature ranking method. It is designed for settings where the number of features is much larger than the number of samples, such as microarray and other gene-expression classification datasets.

What the method does

RPWNSC ranks each feature using two complementary ideas:

  1. Run purity score: samples are sorted by a feature value, and the method checks whether samples from the same class appear in compact contiguous runs. A high score means the sorted labels are less mixed.
  2. Nearest shrunken centroid score: the method measures standardized separation between each class centroid and the overall centroid, while accounting for within-class variation.

The final score is computed as:

RPWNSC_score_j = run_purity_j * scaled_centroid_score_j

This product rewards features that show both compact class-label ordering and strong class discrimination. It also penalizes features that are strong according to only one of the two criteria.

Why use RPWNSC?

  • Works as a classifier-independent filter feature-selection method.
  • Supports binary and multiclass class labels.
  • Does not require wrapper search, feature clustering, or classifier-specific training during ranking.
  • Returns the top feature indices and the final RPWNSC score for every feature.
  • Includes a Huntington's disease gene-expression example dataset for demonstration.

Installation

Install the source package file from your working directory:

install.packages("RPWNSC_0.1.0.tar.gz", repos = NULL, type = "source")
library(RPWNSC)

Quick example

library(RPWNSC)

data(Huntington)

# Use the first 100 genes for a small demonstration.
out <- RPWNSC(Huntington$X[, 1:100], Huntington$Y, topK = 10)

# Top selected feature indices.
out$topK

# Scores for every feature.
out$Scores

Output

RPWNSC() returns a list containing:

Component Description
topK Integer vector containing the indices of the selected top ranked features.
Scores Numeric vector containing the final RPWNSC score for every feature.

Example dataset

The package includes the Huntington's disease gene-expression dataset used for demonstration. It contains 31 samples, 22,283 gene-expression features, and 2 classes.

data(Huntington)
dim(Huntington$X)
table(Huntington$Y)

Reference

Ali, A., Khan, Z., and Aldahmani, S. (2026). A run purity weighted nearest shrunken centroid feature selection for high-dimensional gene-expression classification. Machine Learning with Applications, 25, 100947. DOI: https://doi.org/10.1016/j.mlwa.2026.100947. URL: https://www.sciencedirect.com/science/article/pii/S266682702600112X.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("RPWNSC")

0.1.0 by Amjad Ali, 3 months ago


Browse source code at https://github.com/cran/RPWNSC


Authors: Amjad Ali [aut, cre] , Zardad Khan [aut] , Saeed Aldahmani [aut]


Documentation:   PDF Manual  


GPL-3 license


Imports stats


See at CRAN