| Title: | Run Purity Weighted Nearest Shrunken Centroid Feature Selection |
|---|---|
| Description: | 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) <doi:10.1016/j.mlwa.2026.100947>. |
| Authors: | Amjad Ali [aut, cre], Zardad Khan [aut], Saeed Aldahmani [aut] |
| Maintainer: | Amjad Ali <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.0 |
| Built: | 2026-07-21 12:19:18 UTC |
| Source: | https://github.com/cran/RPWNSC |
The RPWNSC package provides a filter based feature selection method for high-dimensional gene-expression classification.
The package implements the Run Purity Weighted Nearest Shrunken Centroid (RPWNSC) score. For each feature, RPWNSC combines a run purity score, which evaluates the compactness of class labels after sorting samples by that feature, with a scaled nearest shrunken centroid score, which evaluates standardized class centroid separation relative to within-class variation.
The final feature score is the product of the two components. This design favors features that simultaneously provide compact class label ordering and strong class discrimination. The method is classifier independent and does not require wrapper based search, feature clustering, or classifier dependent training during the ranking step.
The main exported function is RPWNSC. The package also includes the Huntington example dataset.
Amjad Ali, Zardad Khan, and Saeed Aldahmani
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.
High-dimensional Huntington's disease gene-expression dataset included for demonstrating the RPWNSC feature selection method.
data(Huntington)data(Huntington)
A list with two components:
Numeric matrix of predictors with 31 samples in rows and 22,283 gene-expression features in columns.
Factor response vector with 31 class labels and 2 classes.
The dataset follows the high-dimensional setting considered in the RPWNSC paper: a small number of observations and a very large number of gene-expression features. It is intended as a package example for testing feature ranking, selected gene extraction, and downstream classification workflows.
Borovecki, F., Lovrecic, L., Zhou, J., Jeong, H., Then, F., Rosas, H. D., Hersch, S. M., Hogarth, P., Bouzou, B., Jensen, R. V., and Krainc, D. (2005). Genome-wide expression profiling of human blood reveals biomarkers for Huntington's disease. Proceedings of the National Academy of Sciences, 102(31), 11023–11028.
data(Huntington) dim(Huntington$X) table(Huntington$Y)data(Huntington) dim(Huntington$X) table(Huntington$Y)
Ranks features using the Run Purity Weighted Nearest Shrunken Centroid (RPWNSC) score and returns the top ranked feature indices.
RPWNSC(X, Y, topK = 10)RPWNSC(X, Y, topK = 10)
X |
A numeric matrix or data frame of predictors with samples in rows and features in columns. |
Y |
A response vector or factor with one class label for each row of |
topK |
Number of top ranked features to return. If |
RPWNSC is a classifier independent filter feature selection method for high-dimensional classification data, especially gene-expression data. The method combines two complementary criteria: a run based label compactness score and a standardized nearest shrunken centroid style separation score.
For each feature, the samples are first sorted according to the feature value. The ordered class labels are divided into contiguous runs, where a run is a maximal consecutive block of samples from the same class. For class and feature , the class wise run purity score is
Here, is the length of run , and is the number of samples from class in the ordered sequence. This score equals 1 when all samples of a class appear in one contiguous run and decreases when the class labels are fragmented. The feature level run purity score is the average over the classes present in the ordered sequence:
The centroid component follows the standardized centroid difference idea used in nearest shrunken centroid methods. The method computes the pooled within class standard deviation, a stabilizing constant, and standardized class centroid differences. The nearest shrunken centroid feature score is
The centroid scores are scaled to the interval [0, 1] across all features, giving .
The final RPWNSC score is the product
This multiplicative score acts as a soft AND rule: a feature receives a high rank only when it has both compact class label ordering and strong standardized class centroid separation. Features with strong centroid separation but mixed sorted labels, or compact sorted labels but weak centroid separation, are penalized.
Non-finite predictor values are replaced by the corresponding feature median before scoring. Feature ranking uses only the supplied X and Y; it does not train a classifier, perform wrapper search, cluster features, or run iterative optimization. In the rare case where all final scores are zero, the function falls back to run purity and then to the scaled centroid score so that a valid ranking is always returned.
A list with the following components:
Integer vector containing the indices of the selected top ranked features.
Numeric vector containing the final RPWNSC score for every feature.
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.
data(Huntington) # Small demonstration using the first 100 genes. out <- RPWNSC(Huntington$X[, 1:100], Huntington$Y, topK = 10) # Selected feature indices. out$topK # RPWNSC scores for every feature. out$Scoresdata(Huntington) # Small demonstration using the first 100 genes. out <- RPWNSC(Huntington$X[, 1:100], Huntington$Y, topK = 10) # Selected feature indices. out$topK # RPWNSC scores for every feature. out$Scores